LLVM  13.0.0git
XCOFFObjectFile.cpp
Go to the documentation of this file.
1 //===--- XCOFFObjectFile.cpp - XCOFF object file implementation -----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the XCOFFObjectFile class.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "llvm/ADT/StringSwitch.h"
17 #include <cstddef>
18 #include <cstring>
19 
20 namespace llvm {
21 
22 using namespace XCOFF;
23 
24 namespace object {
25 
26 static const uint8_t FunctionSym = 0x20;
27 static const uint16_t NoRelMask = 0x0001;
28 static const size_t SymbolAuxTypeOffset = 17;
29 
30 // Checks that [Ptr, Ptr + Size) bytes fall inside the memory buffer
31 // 'M'. Returns a pointer to the underlying object on success.
32 template <typename T>
33 static Expected<const T *> getObject(MemoryBufferRef M, const void *Ptr,
34  const uint64_t Size = sizeof(T)) {
35  uintptr_t Addr = reinterpret_cast<uintptr_t>(Ptr);
36  if (Error E = Binary::checkOffset(M, Addr, Size))
37  return std::move(E);
38  return reinterpret_cast<const T *>(Addr);
39 }
40 
41 static uintptr_t getWithOffset(uintptr_t Base, ptrdiff_t Offset) {
42  return reinterpret_cast<uintptr_t>(reinterpret_cast<const char *>(Base) +
43  Offset);
44 }
45 
46 template <typename T> static const T *viewAs(uintptr_t in) {
47  return reinterpret_cast<const T *>(in);
48 }
49 
51  auto NulCharPtr =
52  static_cast<const char *>(memchr(Name, '\0', XCOFF::NameSize));
53  return NulCharPtr ? StringRef(Name, NulCharPtr - Name)
55 }
56 
57 template <typename T> StringRef XCOFFSectionHeader<T>::getName() const {
58  const T &DerivedXCOFFSectionHeader = static_cast<const T &>(*this);
59  return generateXCOFFFixedNameStringRef(DerivedXCOFFSectionHeader.Name);
60 }
61 
62 template <typename T> uint16_t XCOFFSectionHeader<T>::getSectionType() const {
63  const T &DerivedXCOFFSectionHeader = static_cast<const T &>(*this);
64  return DerivedXCOFFSectionHeader.Flags & SectionFlagsTypeMask;
65 }
66 
67 template <typename T>
69  return getSectionType() & SectionFlagsReservedMask;
70 }
71 
72 bool XCOFFRelocation32::isRelocationSigned() const {
73  return Info & XR_SIGN_INDICATOR_MASK;
74 }
75 
76 bool XCOFFRelocation32::isFixupIndicated() const {
77  return Info & XR_FIXUP_INDICATOR_MASK;
78 }
79 
80 uint8_t XCOFFRelocation32::getRelocatedLength() const {
81  // The relocation encodes the bit length being relocated minus 1. Add back
82  // the 1 to get the actual length being relocated.
83  return (Info & XR_BIASED_LENGTH_MASK) + 1;
84 }
85 
86 uintptr_t
87 XCOFFObjectFile::getAdvancedSymbolEntryAddress(uintptr_t CurrentAddress,
88  uint32_t Distance) {
89  return getWithOffset(CurrentAddress, Distance * XCOFF::SymbolTableEntrySize);
90 }
91 
93 XCOFFObjectFile::getSymbolAuxType(uintptr_t AuxEntryAddress) const {
94  assert(is64Bit() && "64-bit interface called on a 32-bit object file.");
95  return viewAs<XCOFF::SymbolAuxType>(
96  getWithOffset(AuxEntryAddress, SymbolAuxTypeOffset));
97 }
98 
99 void XCOFFObjectFile::checkSectionAddress(uintptr_t Addr,
100  uintptr_t TableAddress) const {
101  if (Addr < TableAddress)
102  report_fatal_error("Section header outside of section header table.");
103 
104  uintptr_t Offset = Addr - TableAddress;
105  if (Offset >= getSectionHeaderSize() * getNumberOfSections())
106  report_fatal_error("Section header outside of section header table.");
107 
108  if (Offset % getSectionHeaderSize() != 0)
110  "Section header pointer does not point to a valid section header.");
111 }
112 
113 const XCOFFSectionHeader32 *
114 XCOFFObjectFile::toSection32(DataRefImpl Ref) const {
115  assert(!is64Bit() && "32-bit interface called on 64-bit object file.");
116 #ifndef NDEBUG
117  checkSectionAddress(Ref.p, getSectionHeaderTableAddress());
118 #endif
119  return viewAs<XCOFFSectionHeader32>(Ref.p);
120 }
121 
122 const XCOFFSectionHeader64 *
123 XCOFFObjectFile::toSection64(DataRefImpl Ref) const {
124  assert(is64Bit() && "64-bit interface called on a 32-bit object file.");
125 #ifndef NDEBUG
126  checkSectionAddress(Ref.p, getSectionHeaderTableAddress());
127 #endif
128  return viewAs<XCOFFSectionHeader64>(Ref.p);
129 }
130 
131 XCOFFSymbolRef XCOFFObjectFile::toSymbolRef(DataRefImpl Ref) const {
132  assert(Ref.p != 0 && "Symbol table pointer can not be nullptr!");
133 #ifndef NDEBUG
134  checkSymbolEntryPointer(Ref.p);
135 #endif
136  return XCOFFSymbolRef(Ref, this);
137 }
138 
139 const XCOFFFileHeader32 *XCOFFObjectFile::fileHeader32() const {
140  assert(!is64Bit() && "32-bit interface called on 64-bit object file.");
141  return static_cast<const XCOFFFileHeader32 *>(FileHeader);
142 }
143 
144 const XCOFFFileHeader64 *XCOFFObjectFile::fileHeader64() const {
145  assert(is64Bit() && "64-bit interface called on a 32-bit object file.");
146  return static_cast<const XCOFFFileHeader64 *>(FileHeader);
147 }
148 
149 const XCOFFSectionHeader32 *
150 XCOFFObjectFile::sectionHeaderTable32() const {
151  assert(!is64Bit() && "32-bit interface called on 64-bit object file.");
152  return static_cast<const XCOFFSectionHeader32 *>(SectionHeaderTable);
153 }
154 
155 const XCOFFSectionHeader64 *
156 XCOFFObjectFile::sectionHeaderTable64() const {
157  assert(is64Bit() && "64-bit interface called on a 32-bit object file.");
158  return static_cast<const XCOFFSectionHeader64 *>(SectionHeaderTable);
159 }
160 
161 void XCOFFObjectFile::moveSymbolNext(DataRefImpl &Symb) const {
162  uintptr_t NextSymbolAddr = getAdvancedSymbolEntryAddress(
163  Symb.p, toSymbolRef(Symb).getNumberOfAuxEntries() + 1);
164 #ifndef NDEBUG
165  // This function is used by basic_symbol_iterator, which allows to
166  // point to the end-of-symbol-table address.
167  if (NextSymbolAddr != getEndOfSymbolTableAddress())
168  checkSymbolEntryPointer(NextSymbolAddr);
169 #endif
170  Symb.p = NextSymbolAddr;
171 }
172 
174 XCOFFObjectFile::getStringTableEntry(uint32_t Offset) const {
175  // The byte offset is relative to the start of the string table.
176  // A byte offset value of 0 is a null or zero-length symbol
177  // name. A byte offset in the range 1 to 3 (inclusive) points into the length
178  // field; as a soft-error recovery mechanism, we treat such cases as having an
179  // offset of 0.
180  if (Offset < 4)
181  return StringRef(nullptr, 0);
182 
183  if (StringTable.Data != nullptr && StringTable.Size > Offset)
184  return (StringTable.Data + Offset);
185 
186  return make_error<GenericBinaryError>("Bad offset for string table entry",
187  object_error::parse_failed);
188 }
189 
191 XCOFFObjectFile::getCFileName(const XCOFFFileAuxEnt *CFileEntPtr) const {
192  if (CFileEntPtr->NameInStrTbl.Magic != XCOFFSymbolRef::NAME_IN_STR_TBL_MAGIC)
193  return generateXCOFFFixedNameStringRef(CFileEntPtr->Name);
194  return getStringTableEntry(CFileEntPtr->NameInStrTbl.Offset);
195 }
196 
198  return toSymbolRef(Symb).getName();
199 }
200 
201 Expected<uint64_t> XCOFFObjectFile::getSymbolAddress(DataRefImpl Symb) const {
202  return toSymbolRef(Symb).getValue();
203 }
204 
205 uint64_t XCOFFObjectFile::getSymbolValueImpl(DataRefImpl Symb) const {
206  return toSymbolRef(Symb).getValue();
207 }
208 
209 uint64_t XCOFFObjectFile::getCommonSymbolSizeImpl(DataRefImpl Symb) const {
210  uint64_t Result = 0;
211  llvm_unreachable("Not yet implemented!");
212  return Result;
213 }
214 
217  llvm_unreachable("Not yet implemented!");
218  return SymbolRef::ST_Other;
219 }
220 
222 XCOFFObjectFile::getSymbolSection(DataRefImpl Symb) const {
223  const int16_t SectNum = toSymbolRef(Symb).getSectionNumber();
224 
225  if (isReservedSectionNumber(SectNum))
226  return section_end();
227 
228  Expected<DataRefImpl> ExpSec = getSectionByNum(SectNum);
229  if (!ExpSec)
230  return ExpSec.takeError();
231 
232  return section_iterator(SectionRef(ExpSec.get(), this));
233 }
234 
235 void XCOFFObjectFile::moveSectionNext(DataRefImpl &Sec) const {
236  const char *Ptr = reinterpret_cast<const char *>(Sec.p);
237  Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize());
238 }
239 
240 Expected<StringRef> XCOFFObjectFile::getSectionName(DataRefImpl Sec) const {
241  return generateXCOFFFixedNameStringRef(getSectionNameInternal(Sec));
242 }
243 
244 uint64_t XCOFFObjectFile::getSectionAddress(DataRefImpl Sec) const {
245  // Avoid ternary due to failure to convert the ubig32_t value to a unit64_t
246  // with MSVC.
247  if (is64Bit())
248  return toSection64(Sec)->VirtualAddress;
249 
250  return toSection32(Sec)->VirtualAddress;
251 }
252 
253 uint64_t XCOFFObjectFile::getSectionIndex(DataRefImpl Sec) const {
254  // Section numbers in XCOFF are numbered beginning at 1. A section number of
255  // zero is used to indicate that a symbol is being imported or is undefined.
256  if (is64Bit())
257  return toSection64(Sec) - sectionHeaderTable64() + 1;
258  else
259  return toSection32(Sec) - sectionHeaderTable32() + 1;
260 }
261 
262 uint64_t XCOFFObjectFile::getSectionSize(DataRefImpl Sec) const {
263  // Avoid ternary due to failure to convert the ubig32_t value to a unit64_t
264  // with MSVC.
265  if (is64Bit())
266  return toSection64(Sec)->SectionSize;
267 
268  return toSection32(Sec)->SectionSize;
269 }
270 
272 XCOFFObjectFile::getSectionContents(DataRefImpl Sec) const {
273  if (isSectionVirtual(Sec))
274  return ArrayRef<uint8_t>();
275 
276  uint64_t OffsetToRaw;
277  if (is64Bit())
278  OffsetToRaw = toSection64(Sec)->FileOffsetToRawData;
279  else
280  OffsetToRaw = toSection32(Sec)->FileOffsetToRawData;
281 
282  const uint8_t * ContentStart = base() + OffsetToRaw;
283  uint64_t SectionSize = getSectionSize(Sec);
284  if (checkOffset(Data, reinterpret_cast<uintptr_t>(ContentStart), SectionSize))
285  return make_error<BinaryError>();
286 
287  return makeArrayRef(ContentStart,SectionSize);
288 }
289 
290 uint64_t XCOFFObjectFile::getSectionAlignment(DataRefImpl Sec) const {
291  uint64_t Result = 0;
292  llvm_unreachable("Not yet implemented!");
293  return Result;
294 }
295 
296 bool XCOFFObjectFile::isSectionCompressed(DataRefImpl Sec) const {
297  return false;
298 }
299 
300 bool XCOFFObjectFile::isSectionText(DataRefImpl Sec) const {
301  return getSectionFlags(Sec) & XCOFF::STYP_TEXT;
302 }
303 
304 bool XCOFFObjectFile::isSectionData(DataRefImpl Sec) const {
305  uint32_t Flags = getSectionFlags(Sec);
306  return Flags & (XCOFF::STYP_DATA | XCOFF::STYP_TDATA);
307 }
308 
309 bool XCOFFObjectFile::isSectionBSS(DataRefImpl Sec) const {
310  uint32_t Flags = getSectionFlags(Sec);
311  return Flags & (XCOFF::STYP_BSS | XCOFF::STYP_TBSS);
312 }
313 
314 bool XCOFFObjectFile::isSectionVirtual(DataRefImpl Sec) const {
315  return is64Bit() ? toSection64(Sec)->FileOffsetToRawData == 0
316  : toSection32(Sec)->FileOffsetToRawData == 0;
317 }
318 
319 relocation_iterator XCOFFObjectFile::section_rel_begin(DataRefImpl Sec) const {
320  if (is64Bit())
321  report_fatal_error("64-bit support not implemented yet");
322  const XCOFFSectionHeader32 *SectionEntPtr = toSection32(Sec);
323  auto RelocationsOrErr = relocations(*SectionEntPtr);
324  if (Error E = RelocationsOrErr.takeError())
327  Ret.p = reinterpret_cast<uintptr_t>(&*RelocationsOrErr.get().begin());
328  return relocation_iterator(RelocationRef(Ret, this));
329 }
330 
331 relocation_iterator XCOFFObjectFile::section_rel_end(DataRefImpl Sec) const {
332  if (is64Bit())
333  report_fatal_error("64-bit support not implemented yet");
334  const XCOFFSectionHeader32 *SectionEntPtr = toSection32(Sec);
335  auto RelocationsOrErr = relocations(*SectionEntPtr);
336  if (Error E = RelocationsOrErr.takeError())
339  Ret.p = reinterpret_cast<uintptr_t>(&*RelocationsOrErr.get().end());
340  return relocation_iterator(RelocationRef(Ret, this));
341 }
342 
343 void XCOFFObjectFile::moveRelocationNext(DataRefImpl &Rel) const {
344  Rel.p = reinterpret_cast<uintptr_t>(viewAs<XCOFFRelocation32>(Rel.p) + 1);
345 }
346 
347 uint64_t XCOFFObjectFile::getRelocationOffset(DataRefImpl Rel) const {
348  if (is64Bit())
349  report_fatal_error("64-bit support not implemented yet");
350  const XCOFFRelocation32 *Reloc = viewAs<XCOFFRelocation32>(Rel.p);
351  const XCOFFSectionHeader32 *Sec32 = sectionHeaderTable32();
352  const uint32_t RelocAddress = Reloc->VirtualAddress;
353  const uint16_t NumberOfSections = getNumberOfSections();
354  for (uint16_t i = 0; i < NumberOfSections; ++i) {
355  // Find which section this relocation is belonging to, and get the
356  // relocation offset relative to the start of the section.
357  if (Sec32->VirtualAddress <= RelocAddress &&
358  RelocAddress < Sec32->VirtualAddress + Sec32->SectionSize) {
359  return RelocAddress - Sec32->VirtualAddress;
360  }
361  ++Sec32;
362  }
363  return InvalidRelocOffset;
364 }
365 
366 symbol_iterator XCOFFObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
367  if (is64Bit())
368  report_fatal_error("64-bit support not implemented yet");
369  const XCOFFRelocation32 *Reloc = viewAs<XCOFFRelocation32>(Rel.p);
370  const uint32_t Index = Reloc->SymbolIndex;
371 
372  if (Index >= getLogicalNumberOfSymbolTableEntries32())
373  return symbol_end();
374 
375  DataRefImpl SymDRI;
376  SymDRI.p = getSymbolEntryAddressByIndex(Index);
377  return symbol_iterator(SymbolRef(SymDRI, this));
378 }
379 
380 uint64_t XCOFFObjectFile::getRelocationType(DataRefImpl Rel) const {
381  if (is64Bit())
382  report_fatal_error("64-bit support not implemented yet");
383  return viewAs<XCOFFRelocation32>(Rel.p)->Type;
384 }
385 
386 void XCOFFObjectFile::getRelocationTypeName(
387  DataRefImpl Rel, SmallVectorImpl<char> &Result) const {
388  if (is64Bit())
389  report_fatal_error("64-bit support not implemented yet");
390  const XCOFFRelocation32 *Reloc = viewAs<XCOFFRelocation32>(Rel.p);
392  Result.append(Res.begin(), Res.end());
393 }
394 
395 Expected<uint32_t> XCOFFObjectFile::getSymbolFlags(DataRefImpl Symb) const {
396  uint32_t Result = 0;
397  llvm_unreachable("Not yet implemented!");
398  return Result;
399 }
400 
401 basic_symbol_iterator XCOFFObjectFile::symbol_begin() const {
402  DataRefImpl SymDRI;
403  SymDRI.p = reinterpret_cast<uintptr_t>(SymbolTblPtr);
404  return basic_symbol_iterator(SymbolRef(SymDRI, this));
405 }
406 
407 basic_symbol_iterator XCOFFObjectFile::symbol_end() const {
408  DataRefImpl SymDRI;
409  const uint32_t NumberOfSymbolTableEntries = getNumberOfSymbolTableEntries();
410  SymDRI.p = getSymbolEntryAddressByIndex(NumberOfSymbolTableEntries);
411  return basic_symbol_iterator(SymbolRef(SymDRI, this));
412 }
413 
414 section_iterator XCOFFObjectFile::section_begin() const {
415  DataRefImpl DRI;
416  DRI.p = getSectionHeaderTableAddress();
417  return section_iterator(SectionRef(DRI, this));
418 }
419 
420 section_iterator XCOFFObjectFile::section_end() const {
421  DataRefImpl DRI;
422  DRI.p = getWithOffset(getSectionHeaderTableAddress(),
423  getNumberOfSections() * getSectionHeaderSize());
424  return section_iterator(SectionRef(DRI, this));
425 }
426 
427 uint8_t XCOFFObjectFile::getBytesInAddress() const { return is64Bit() ? 8 : 4; }
428 
429 StringRef XCOFFObjectFile::getFileFormatName() const {
430  return is64Bit() ? "aix5coff64-rs6000" : "aixcoff-rs6000";
431 }
432 
433 Triple::ArchType XCOFFObjectFile::getArch() const {
434  return is64Bit() ? Triple::ppc64 : Triple::ppc;
435 }
436 
438  return SubtargetFeatures();
439 }
440 
441 bool XCOFFObjectFile::isRelocatableObject() const {
442  if (is64Bit())
443  return !(fileHeader64()->Flags & NoRelMask);
444  return !(fileHeader32()->Flags & NoRelMask);
445 }
446 
447 Expected<uint64_t> XCOFFObjectFile::getStartAddress() const {
448  // TODO FIXME Should get from auxiliary_header->o_entry when support for the
449  // auxiliary_header is added.
450  return 0;
451 }
452 
453 StringRef XCOFFObjectFile::mapDebugSectionName(StringRef Name) const {
455  .Case("dwinfo", "debug_info")
456  .Case("dwline", "debug_line")
457  .Case("dwpbnms", "debug_pubnames")
458  .Case("dwpbtyp", "debug_pubtypes")
459  .Case("dwarnge", "debug_aranges")
460  .Case("dwabrev", "debug_abbrev")
461  .Case("dwstr", "debug_str")
462  .Case("dwrnges", "debug_ranges")
463  .Case("dwloc", "debug_loc")
464  .Case("dwframe", "debug_frame")
465  .Case("dwmac", "debug_macinfo")
466  .Default(Name);
467 }
468 
469 size_t XCOFFObjectFile::getFileHeaderSize() const {
470  return is64Bit() ? sizeof(XCOFFFileHeader64) : sizeof(XCOFFFileHeader32);
471 }
472 
473 size_t XCOFFObjectFile::getSectionHeaderSize() const {
474  return is64Bit() ? sizeof(XCOFFSectionHeader64) :
475  sizeof(XCOFFSectionHeader32);
476 }
477 
479  return Binary::ID_XCOFF64 == getType();
480 }
481 
483  return is64Bit() ? fileHeader64()->Magic : fileHeader32()->Magic;
484 }
485 
486 Expected<DataRefImpl> XCOFFObjectFile::getSectionByNum(int16_t Num) const {
487  if (Num <= 0 || Num > getNumberOfSections())
488  return errorCodeToError(object_error::invalid_section_index);
489 
490  DataRefImpl DRI;
491  DRI.p = getWithOffset(getSectionHeaderTableAddress(),
492  getSectionHeaderSize() * (Num - 1));
493  return DRI;
494 }
495 
497 XCOFFObjectFile::getSymbolSectionName(XCOFFSymbolRef SymEntPtr) const {
498  const int16_t SectionNum = SymEntPtr.getSectionNumber();
499 
500  switch (SectionNum) {
501  case XCOFF::N_DEBUG:
502  return "N_DEBUG";
503  case XCOFF::N_ABS:
504  return "N_ABS";
505  case XCOFF::N_UNDEF:
506  return "N_UNDEF";
507  default:
508  Expected<DataRefImpl> SecRef = getSectionByNum(SectionNum);
509  if (SecRef)
511  getSectionNameInternal(SecRef.get()));
512  return SecRef.takeError();
513  }
514 }
515 
516 bool XCOFFObjectFile::isReservedSectionNumber(int16_t SectionNumber) {
517  return (SectionNumber <= 0 && SectionNumber >= -2);
518 }
519 
520 uint16_t XCOFFObjectFile::getNumberOfSections() const {
521  return is64Bit() ? fileHeader64()->NumberOfSections
522  : fileHeader32()->NumberOfSections;
523 }
524 
525 int32_t XCOFFObjectFile::getTimeStamp() const {
526  return is64Bit() ? fileHeader64()->TimeStamp : fileHeader32()->TimeStamp;
527 }
528 
529 uint16_t XCOFFObjectFile::getOptionalHeaderSize() const {
530  return is64Bit() ? fileHeader64()->AuxHeaderSize
531  : fileHeader32()->AuxHeaderSize;
532 }
533 
534 uint32_t XCOFFObjectFile::getSymbolTableOffset32() const {
535  return fileHeader32()->SymbolTableOffset;
536 }
537 
538 int32_t XCOFFObjectFile::getRawNumberOfSymbolTableEntries32() const {
539  // As far as symbol table size is concerned, if this field is negative it is
540  // to be treated as a 0. However since this field is also used for printing we
541  // don't want to truncate any negative values.
542  return fileHeader32()->NumberOfSymTableEntries;
543 }
544 
545 uint32_t XCOFFObjectFile::getLogicalNumberOfSymbolTableEntries32() const {
546  return (fileHeader32()->NumberOfSymTableEntries >= 0
547  ? fileHeader32()->NumberOfSymTableEntries
548  : 0);
549 }
550 
551 uint64_t XCOFFObjectFile::getSymbolTableOffset64() const {
552  return fileHeader64()->SymbolTableOffset;
553 }
554 
555 uint32_t XCOFFObjectFile::getNumberOfSymbolTableEntries64() const {
556  return fileHeader64()->NumberOfSymTableEntries;
557 }
558 
559 uint32_t XCOFFObjectFile::getNumberOfSymbolTableEntries() const {
560  return is64Bit() ? getNumberOfSymbolTableEntries64()
561  : getLogicalNumberOfSymbolTableEntries32();
562 }
563 
564 uintptr_t XCOFFObjectFile::getEndOfSymbolTableAddress() const {
565  const uint32_t NumberOfSymTableEntries = getNumberOfSymbolTableEntries();
566  return getWithOffset(reinterpret_cast<uintptr_t>(SymbolTblPtr),
567  XCOFF::SymbolTableEntrySize * NumberOfSymTableEntries);
568 }
569 
570 void XCOFFObjectFile::checkSymbolEntryPointer(uintptr_t SymbolEntPtr) const {
571  if (SymbolEntPtr < reinterpret_cast<uintptr_t>(SymbolTblPtr))
572  report_fatal_error("Symbol table entry is outside of symbol table.");
573 
574  if (SymbolEntPtr >= getEndOfSymbolTableAddress())
575  report_fatal_error("Symbol table entry is outside of symbol table.");
576 
577  ptrdiff_t Offset = reinterpret_cast<const char *>(SymbolEntPtr) -
578  reinterpret_cast<const char *>(SymbolTblPtr);
579 
582  "Symbol table entry position is not valid inside of symbol table.");
583 }
584 
585 uint32_t XCOFFObjectFile::getSymbolIndex(uintptr_t SymbolEntPtr) const {
586  return (reinterpret_cast<const char *>(SymbolEntPtr) -
587  reinterpret_cast<const char *>(SymbolTblPtr)) /
589 }
590 
591 uintptr_t XCOFFObjectFile::getSymbolEntryAddressByIndex(uint32_t Index) const {
592  return getAdvancedSymbolEntryAddress(
593  reinterpret_cast<uintptr_t>(getPointerToSymbolTable()), Index);
594 }
595 
597 XCOFFObjectFile::getSymbolNameByIndex(uint32_t Index) const {
598  const uint32_t NumberOfSymTableEntries = getNumberOfSymbolTableEntries();
599 
600  if (Index >= NumberOfSymTableEntries)
601  return errorCodeToError(object_error::invalid_symbol_index);
602 
603  DataRefImpl SymDRI;
604  SymDRI.p = getSymbolEntryAddressByIndex(Index);
605  return getSymbolName(SymDRI);
606 }
607 
609  return is64Bit() ? fileHeader64()->Flags : fileHeader32()->Flags;
610 }
611 
612 const char *XCOFFObjectFile::getSectionNameInternal(DataRefImpl Sec) const {
613  return is64Bit() ? toSection64(Sec)->Name : toSection32(Sec)->Name;
614 }
615 
616 uintptr_t XCOFFObjectFile::getSectionHeaderTableAddress() const {
617  return reinterpret_cast<uintptr_t>(SectionHeaderTable);
618 }
619 
621  return is64Bit() ? toSection64(Sec)->Flags : toSection32(Sec)->Flags;
622 }
623 
624 XCOFFObjectFile::XCOFFObjectFile(unsigned int Type, MemoryBufferRef Object)
625  : ObjectFile(Type, Object) {
627 }
628 
630  assert(is64Bit() && "64-bit interface called for non 64-bit file.");
631  const XCOFFSectionHeader64 *TablePtr = sectionHeaderTable64();
632  return ArrayRef<XCOFFSectionHeader64>(TablePtr,
633  TablePtr + getNumberOfSections());
634 }
635 
637  assert(!is64Bit() && "32-bit interface called for non 32-bit file.");
638  const XCOFFSectionHeader32 *TablePtr = sectionHeaderTable32();
639  return ArrayRef<XCOFFSectionHeader32>(TablePtr,
640  TablePtr + getNumberOfSections());
641 }
642 
643 // In an XCOFF32 file, when the field value is 65535, then an STYP_OVRFLO
644 // section header contains the actual count of relocation entries in the s_paddr
645 // field. STYP_OVRFLO headers contain the section index of their corresponding
646 // sections as their raw "NumberOfRelocations" field value.
648  const XCOFFSectionHeader32 &Sec) const {
649 
650  uint16_t SectionIndex = &Sec - sectionHeaderTable32() + 1;
651 
653  return Sec.NumberOfRelocations;
654  for (const auto &Sec : sections32()) {
655  if (Sec.Flags == XCOFF::STYP_OVRFLO &&
656  Sec.NumberOfRelocations == SectionIndex)
657  return Sec.PhysicalAddress;
658  }
660 }
661 
664  uintptr_t RelocAddr = getWithOffset(reinterpret_cast<uintptr_t>(FileHeader),
666  auto NumRelocEntriesOrErr = getLogicalNumberOfRelocationEntries(Sec);
667  if (Error E = NumRelocEntriesOrErr.takeError())
668  return std::move(E);
669 
670  uint32_t NumRelocEntries = NumRelocEntriesOrErr.get();
671 
672  static_assert(
674  auto RelocationOrErr =
675  getObject<XCOFFRelocation32>(Data, reinterpret_cast<void *>(RelocAddr),
676  NumRelocEntries * sizeof(XCOFFRelocation32));
677  if (Error E = RelocationOrErr.takeError())
678  return std::move(E);
679 
680  const XCOFFRelocation32 *StartReloc = RelocationOrErr.get();
681 
682  return ArrayRef<XCOFFRelocation32>(StartReloc, StartReloc + NumRelocEntries);
683 }
684 
686 XCOFFObjectFile::parseStringTable(const XCOFFObjectFile *Obj, uint64_t Offset) {
687  // If there is a string table, then the buffer must contain at least 4 bytes
688  // for the string table's size. Not having a string table is not an error.
690  Obj->Data, reinterpret_cast<uintptr_t>(Obj->base() + Offset), 4)) {
692  return XCOFFStringTable{0, nullptr};
693  }
694 
695  // Read the size out of the buffer.
697 
698  // If the size is less then 4, then the string table is just a size and no
699  // string data.
700  if (Size <= 4)
701  return XCOFFStringTable{4, nullptr};
702 
703  auto StringTableOrErr =
704  getObject<char>(Obj->Data, Obj->base() + Offset, Size);
705  if (Error E = StringTableOrErr.takeError())
706  return std::move(E);
707 
708  const char *StringTablePtr = StringTableOrErr.get();
709  if (StringTablePtr[Size - 1] != '\0')
711 
712  return XCOFFStringTable{Size, StringTablePtr};
713 }
714 
715 Expected<std::unique_ptr<XCOFFObjectFile>>
716 XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) {
717  // Can't use std::make_unique because of the private constructor.
718  std::unique_ptr<XCOFFObjectFile> Obj;
719  Obj.reset(new XCOFFObjectFile(Type, MBR));
720 
721  uint64_t CurOffset = 0;
722  const auto *Base = Obj->base();
723  MemoryBufferRef Data = Obj->Data;
724 
725  // Parse file header.
726  auto FileHeaderOrErr =
727  getObject<void>(Data, Base + CurOffset, Obj->getFileHeaderSize());
728  if (Error E = FileHeaderOrErr.takeError())
729  return std::move(E);
730  Obj->FileHeader = FileHeaderOrErr.get();
731 
732  CurOffset += Obj->getFileHeaderSize();
733  // TODO FIXME we don't have support for an optional header yet, so just skip
734  // past it.
735  CurOffset += Obj->getOptionalHeaderSize();
736 
737  // Parse the section header table if it is present.
738  if (Obj->getNumberOfSections()) {
739  auto SecHeadersOrErr = getObject<void>(Data, Base + CurOffset,
740  Obj->getNumberOfSections() *
741  Obj->getSectionHeaderSize());
742  if (Error E = SecHeadersOrErr.takeError())
743  return std::move(E);
744  Obj->SectionHeaderTable = SecHeadersOrErr.get();
745  }
746 
747  const uint32_t NumberOfSymbolTableEntries =
748  Obj->getNumberOfSymbolTableEntries();
749 
750  // If there is no symbol table we are done parsing the memory buffer.
751  if (NumberOfSymbolTableEntries == 0)
752  return std::move(Obj);
753 
754  // Parse symbol table.
755  CurOffset = Obj->is64Bit() ? Obj->getSymbolTableOffset64()
756  : Obj->getSymbolTableOffset32();
757  const uint64_t SymbolTableSize =
758  static_cast<uint64_t>(XCOFF::SymbolTableEntrySize) *
759  NumberOfSymbolTableEntries;
760  auto SymTableOrErr =
761  getObject<void *>(Data, Base + CurOffset, SymbolTableSize);
762  if (Error E = SymTableOrErr.takeError())
763  return std::move(E);
764  Obj->SymbolTblPtr = SymTableOrErr.get();
765  CurOffset += SymbolTableSize;
766 
767  // Parse String table.
768  Expected<XCOFFStringTable> StringTableOrErr =
769  parseStringTable(Obj.get(), CurOffset);
770  if (Error E = StringTableOrErr.takeError())
771  return std::move(E);
772  Obj->StringTable = StringTableOrErr.get();
773 
774  return std::move(Obj);
775 }
776 
777 Expected<std::unique_ptr<ObjectFile>>
779  unsigned FileType) {
780  return XCOFFObjectFile::create(FileType, MemBufRef);
781 }
782 
784  if (!isCsectSymbol())
785  return false;
786 
787  if (getSymbolType() & FunctionSym)
788  return true;
789 
791  if (!ExpCsectAuxEnt)
792  return false;
793 
794  const XCOFFCsectAuxRef CsectAuxRef = ExpCsectAuxEnt.get();
795 
796  // A function definition should be a label definition.
797  // FIXME: This is not necessarily the case when -ffunction-sections is
798  // enabled.
799  if (!CsectAuxRef.isLabel())
800  return false;
801 
802  if (CsectAuxRef.getStorageMappingClass() != XCOFF::XMC_PR)
803  return false;
804 
805  const int16_t SectNum = getSectionNumber();
806  Expected<DataRefImpl> SI = OwningObjectPtr->getSectionByNum(SectNum);
807  if (!SI) {
808  // If we could not get the section, then this symbol should not be
809  // a function. So consume the error and return `false` to move on.
810  consumeError(SI.takeError());
811  return false;
812  }
813 
814  return (OwningObjectPtr->getSectionFlags(SI.get()) & XCOFF::STYP_TEXT);
815 }
816 
819  return (SC == XCOFF::C_EXT || SC == XCOFF::C_WEAKEXT ||
820  SC == XCOFF::C_HIDEXT);
821 }
822 
824  assert(isCsectSymbol() &&
825  "Calling csect symbol interface with a non-csect symbol.");
826 
827  uint8_t NumberOfAuxEntries = getNumberOfAuxEntries();
828 
829  Expected<StringRef> NameOrErr = getName();
830  if (auto Err = NameOrErr.takeError())
831  return std::move(Err);
832 
833  if (!NumberOfAuxEntries) {
835  "csect symbol \"" + *NameOrErr +
836  "\" contains no auxiliary entry");
837  }
838 
839  if (!OwningObjectPtr->is64Bit()) {
840  // In XCOFF32, the csect auxilliary entry is always the last auxiliary
841  // entry for the symbol.
843  getEntryAddress(), NumberOfAuxEntries);
844  return XCOFFCsectAuxRef(viewAs<XCOFFCsectAuxEnt32>(AuxAddr));
845  }
846 
847  // XCOFF64 uses SymbolAuxType to identify the auxiliary entry type.
848  // We need to iterate through all the auxiliary entries to find it.
849  for (uint8_t Index = NumberOfAuxEntries; Index > 0; --Index) {
852  if (*OwningObjectPtr->getSymbolAuxType(AuxAddr) ==
854 #ifndef NDEBUG
855  OwningObjectPtr->checkSymbolEntryPointer(AuxAddr);
856 #endif
857  return XCOFFCsectAuxRef(viewAs<XCOFFCsectAuxEnt64>(AuxAddr));
858  }
859  }
860 
861  return createStringError(
863  "a csect auxiliary entry is not found for symbol \"" + *NameOrErr + "\"");
864 }
865 
867  // A storage class value with the high-order bit on indicates that the name is
868  // a symbolic debugger stabstring.
869  if (getStorageClass() & 0x80)
870  return StringRef("Unimplemented Debug Name");
871 
872  if (Entry32) {
875 
876  return OwningObjectPtr->getStringTableEntry(Entry32->NameInStrTbl.Offset);
877  }
878 
879  return OwningObjectPtr->getStringTableEntry(Entry64->Offset);
880 }
881 
882 // Explictly instantiate template classes.
885 
887  if (Bytes.size() < 4)
888  return false;
889 
890  return support::endian::read32be(Bytes.data()) == 0;
891 }
892 
893 TBVectorExt::TBVectorExt(StringRef TBvectorStrRef) {
894  const uint8_t *Ptr = reinterpret_cast<const uint8_t *>(TBvectorStrRef.data());
896  VecParmsInfo = support::endian::read32be(Ptr + 2);
897 }
898 
899 #define GETVALUEWITHMASK(X) (Data & (TracebackTable::X))
900 #define GETVALUEWITHMASKSHIFT(X, S) \
901  ((Data & (TracebackTable::X)) >> (TracebackTable::S))
903  return GETVALUEWITHMASKSHIFT(NumberOfVRSavedMask, NumberOfVRSavedShift);
904 }
905 
907  return GETVALUEWITHMASK(IsVRSavedOnStackMask);
908 }
909 
911  return GETVALUEWITHMASK(HasVarArgsMask);
912 }
914  return GETVALUEWITHMASKSHIFT(NumberOfVectorParmsMask,
915  NumberOfVectorParmsShift);
916 }
917 
919  return GETVALUEWITHMASK(HasVMXInstructionMask);
920 }
921 #undef GETVALUEWITHMASK
922 #undef GETVALUEWITHMASKSHIFT
923 
925  SmallString<32> ParmsType;
926  uint32_t Value = VecParmsInfo;
927  for (uint8_t I = 0; I < getNumberOfVectorParms(); ++I) {
928  if (I != 0)
929  ParmsType += ", ";
932  ParmsType += "vc";
933  break;
934 
936  ParmsType += "vs";
937  break;
938 
940  ParmsType += "vi";
941  break;
942 
944  ParmsType += "vf";
945  break;
946  }
947  Value <<= 2;
948  }
949  return ParmsType;
950 }
951 
953  unsigned int ParmsNum) {
954  SmallString<32> ParmsType;
955  unsigned I = 0;
956  bool Begin = false;
957  while (I < ParmsNum || Value) {
958  if (Begin)
959  ParmsType += ", ";
960  else
961  Begin = true;
962 
965  ParmsType += "i";
966  ++I;
967  break;
969  ParmsType += "v";
970  break;
972  ParmsType += "f";
973  ++I;
974  break;
976  ParmsType += "d";
977  ++I;
978  break;
979  default:
980  assert(false && "Unrecognized bits in ParmsType.");
981  }
982  Value <<= 2;
983  }
984  assert(I == ParmsNum &&
985  "The total parameters number of fixed-point or floating-point "
986  "parameters not equal to the number in the parameter type!");
987  return ParmsType;
988 }
989 
991  uint64_t &Size) {
992  Error Err = Error::success();
993  XCOFFTracebackTable TBT(Ptr, Size, Err);
994  if (Err)
995  return std::move(Err);
996  return TBT;
997 }
998 
999 XCOFFTracebackTable::XCOFFTracebackTable(const uint8_t *Ptr, uint64_t &Size,
1000  Error &Err)
1001  : TBPtr(Ptr) {
1002  ErrorAsOutParameter EAO(&Err);
1003  DataExtractor DE(ArrayRef<uint8_t>(Ptr, Size), /*IsLittleEndian=*/false,
1004  /*AddressSize=*/0);
1005  DataExtractor::Cursor Cur(/*Offset=*/0);
1006 
1007  // Skip 8 bytes of mandatory fields.
1008  DE.getU64(Cur);
1009 
1010  // Begin to parse optional fields.
1011  if (Cur) {
1012  unsigned ParmNum = getNumberOfFixedParms() + getNumberOfFPParms();
1013 
1014  // As long as there are no "fixed-point" or floating-point parameters, this
1015  // field remains not present even when hasVectorInfo gives true and
1016  // indicates the presence of vector parameters.
1017  if (ParmNum > 0) {
1018  uint32_t ParamsTypeValue = DE.getU32(Cur);
1019  if (Cur)
1020  ParmsType = hasVectorInfo()
1021  ? parseParmsTypeWithVecInfo(ParamsTypeValue, ParmNum)
1022  : parseParmsType(ParamsTypeValue, ParmNum);
1023  }
1024  }
1025 
1026  if (Cur && hasTraceBackTableOffset())
1027  TraceBackTableOffset = DE.getU32(Cur);
1028 
1029  if (Cur && isInterruptHandler())
1030  HandlerMask = DE.getU32(Cur);
1031 
1032  if (Cur && hasControlledStorage()) {
1033  NumOfCtlAnchors = DE.getU32(Cur);
1034  if (Cur && NumOfCtlAnchors) {
1035  SmallVector<uint32_t, 8> Disp;
1036  Disp.reserve(NumOfCtlAnchors.getValue());
1037  for (uint32_t I = 0; I < NumOfCtlAnchors && Cur; ++I)
1038  Disp.push_back(DE.getU32(Cur));
1039  if (Cur)
1040  ControlledStorageInfoDisp = std::move(Disp);
1041  }
1042  }
1043 
1044  if (Cur && isFuncNamePresent()) {
1045  uint16_t FunctionNameLen = DE.getU16(Cur);
1046  if (Cur)
1047  FunctionName = DE.getBytes(Cur, FunctionNameLen);
1048  }
1049 
1050  if (Cur && isAllocaUsed())
1051  AllocaRegister = DE.getU8(Cur);
1052 
1053  if (Cur && hasVectorInfo()) {
1054  StringRef VectorExtRef = DE.getBytes(Cur, 6);
1055  if (Cur)
1056  VecExt = TBVectorExt(VectorExtRef);
1057  }
1058 
1059  if (Cur && hasExtensionTable())
1060  ExtensionTable = DE.getU8(Cur);
1061 
1062  if (!Cur)
1063  Err = Cur.takeError();
1064  Size = Cur.tell();
1065 }
1066 
1067 #define GETBITWITHMASK(P, X) \
1068  (support::endian::read32be(TBPtr + (P)) & (TracebackTable::X))
1069 #define GETBITWITHMASKSHIFT(P, X, S) \
1070  ((support::endian::read32be(TBPtr + (P)) & (TracebackTable::X)) >> \
1071  (TracebackTable::S))
1072 
1074  return GETBITWITHMASKSHIFT(0, VersionMask, VersionShift);
1075 }
1076 
1078  return GETBITWITHMASKSHIFT(0, LanguageIdMask, LanguageIdShift);
1079 }
1080 
1082  return GETBITWITHMASK(0, IsGlobaLinkageMask);
1083 }
1084 
1086  return GETBITWITHMASK(0, IsOutOfLineEpilogOrPrologueMask);
1087 }
1088 
1090  return GETBITWITHMASK(0, HasTraceBackTableOffsetMask);
1091 }
1092 
1094  return GETBITWITHMASK(0, IsInternalProcedureMask);
1095 }
1096 
1098  return GETBITWITHMASK(0, HasControlledStorageMask);
1099 }
1100 
1102  return GETBITWITHMASK(0, IsTOClessMask);
1103 }
1104 
1106  return GETBITWITHMASK(0, IsFloatingPointPresentMask);
1107 }
1108 
1110  return GETBITWITHMASK(0, IsFloatingPointOperationLogOrAbortEnabledMask);
1111 }
1112 
1114  return GETBITWITHMASK(0, IsInterruptHandlerMask);
1115 }
1116 
1118  return GETBITWITHMASK(0, IsFunctionNamePresentMask);
1119 }
1120 
1122  return GETBITWITHMASK(0, IsAllocaUsedMask);
1123 }
1124 
1126  return GETBITWITHMASKSHIFT(0, OnConditionDirectiveMask,
1127  OnConditionDirectiveShift);
1128 }
1129 
1131  return GETBITWITHMASK(0, IsCRSavedMask);
1132 }
1133 
1135  return GETBITWITHMASK(0, IsLRSavedMask);
1136 }
1137 
1139  return GETBITWITHMASK(4, IsBackChainStoredMask);
1140 }
1141 
1143  return GETBITWITHMASK(4, IsFixupMask);
1144 }
1145 
1147  return GETBITWITHMASKSHIFT(4, FPRSavedMask, FPRSavedShift);
1148 }
1149 
1151  return GETBITWITHMASK(4, HasExtensionTableMask);
1152 }
1153 
1155  return GETBITWITHMASK(4, HasVectorInfoMask);
1156 }
1157 
1159  return GETBITWITHMASKSHIFT(4, GPRSavedMask, GPRSavedShift);
1160 }
1161 
1163  return GETBITWITHMASKSHIFT(4, NumberOfFixedParmsMask,
1164  NumberOfFixedParmsShift);
1165 }
1166 
1168  return GETBITWITHMASKSHIFT(4, NumberOfFloatingPointParmsMask,
1169  NumberOfFloatingPointParmsShift);
1170 }
1171 
1173  return GETBITWITHMASK(4, HasParmsOnStackMask);
1174 }
1175 
1176 #undef GETBITWITHMASK
1177 #undef GETBITWITHMASKSHIFT
1178 } // namespace object
1179 } // namespace llvm
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::StringSwitch::Case
StringSwitch & Case(StringLiteral S, T Value)
Definition: StringSwitch.h:67
i
i
Definition: README.txt:29
llvm::object::XCOFFTracebackTable::isTOCless
bool isTOCless() const
Definition: XCOFFObjectFile.cpp:1101
llvm::object::XCOFFTracebackTable::isInterruptHandler
bool isInterruptHandler() const
Definition: XCOFFObjectFile.cpp:1113
getName
static StringRef getName(Value *V)
Definition: ProvenanceAnalysisEvaluator.cpp:42
llvm
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::object::XCOFFSectionHeader32
Definition: XCOFFObjectFile.h:73
llvm::object::XCOFFTracebackTable::hasParmsOnStack
bool hasParmsOnStack() const
Definition: XCOFFObjectFile.cpp:1172
llvm::object::XCOFFSymbolRef::getXCOFFCsectAuxRef
Expected< XCOFFCsectAuxRef > getXCOFFCsectAuxRef() const
Definition: XCOFFObjectFile.cpp:823
llvm::object::TBVectorExt::hasVarArgs
bool hasVarArgs() const
Definition: XCOFFObjectFile.cpp:910
llvm::object::XCOFFSymbolRef::getName
Expected< StringRef > getName() const
Definition: XCOFFObjectFile.cpp:866
llvm::object::XCOFFFileHeader32
Definition: XCOFFObjectFile.h:26
llvm::StringSwitch::Default
LLVM_NODISCARD R Default(T Value)
Definition: StringSwitch.h:181
is64Bit
static bool is64Bit(const char *name)
Definition: X86Disassembler.cpp:1005
llvm::XCOFF::STYP_BSS
@ STYP_BSS
Definition: XCOFF.h:76
llvm::object::XCOFFTracebackTable::isFloatingPointPresent
bool isFloatingPointPresent() const
Definition: XCOFFObjectFile.cpp:1105
llvm::object::NoRelMask
static const uint16_t NoRelMask
Definition: XCOFFObjectFile.cpp:27
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:332
llvm::object::parseParmsTypeWithVecInfo
static SmallString< 32 > parseParmsTypeWithVecInfo(uint32_t Value, unsigned int ParmsNum)
Definition: XCOFFObjectFile.cpp:952
llvm::object::XCOFFTracebackTable::getVersion
uint8_t getVersion() const
Definition: XCOFFObjectFile.cpp:1073
llvm::XCOFF::XMC_PR
@ XMC_PR
Program Code.
Definition: XCOFF.h:42
llvm::object::XCOFFSectionHeader32::FileOffsetToRelocationInfo
support::ubig32_t FileOffsetToRelocationInfo
Definition: XCOFFObjectFile.h:79
llvm::object::XCOFFTracebackTable::isBackChainStored
bool isBackChainStored() const
Definition: XCOFFObjectFile.cpp:1138
llvm::object::XCOFFSectionHeader
Definition: XCOFFObjectFile.h:54
llvm::object::getWithOffset
static uintptr_t getWithOffset(uintptr_t Base, ptrdiff_t Offset)
Definition: XCOFFObjectFile.cpp:41
llvm::object::relocation_iterator
content_iterator< RelocationRef > relocation_iterator
Definition: ObjectFile.h:76
llvm::object::XCOFFObjectFile::is64Bit
bool is64Bit() const
Definition: XCOFFObjectFile.cpp:478
llvm::object::XCOFFTracebackTable::isOutOfLineEpilogOrPrologue
bool isOutOfLineEpilogOrPrologue() const
Definition: XCOFFObjectFile.cpp:1085
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::object::Binary::Data
MemoryBufferRef Data
Definition: Binary.h:37
llvm::object::XCOFFFileAuxEnt::NameInStrTblType::Magic
support::big32_t Magic
Definition: XCOFFObjectFile.h:211
llvm::Triple::ppc
@ ppc
Definition: Triple.h:67
llvm::object::TBVectorExt::hasVMXInstruction
bool hasVMXInstruction() const
Definition: XCOFFObjectFile.cpp:918
T
#define T
Definition: Mips16ISelLowering.cpp:341
GETBITWITHMASKSHIFT
#define GETBITWITHMASKSHIFT(P, X, S)
Definition: XCOFFObjectFile.cpp:1069
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::object::XCOFFFileAuxEnt::Name
char Name[XCOFF::NameSize+XCOFF::FileNamePadSize]
Definition: XCOFFObjectFile.h:216
llvm::RawInstrProf::getMagic
uint64_t getMagic()
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:116
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::support::endian::read32be
uint32_t read32be(const void *P)
Definition: Endian.h:384
llvm::object::XCOFFSymbolRef::getNumberOfAuxEntries
uint8_t getNumberOfAuxEntries() const
Definition: XCOFFObjectFile.h:519
llvm::object::XCOFFFileHeader64
Definition: XCOFFObjectFile.h:40
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:1006
llvm::object::XCOFFRelocation32::Type
XCOFF::RelocationType Type
Definition: XCOFFObjectFile.h:253
llvm::Data
@ Data
Definition: SIMachineScheduler.h:56
llvm::MemoryBufferRef
Definition: MemoryBufferRef.h:22
llvm::object::XCOFFSectionHeader32::NumberOfRelocations
support::ubig16_t NumberOfRelocations
Definition: XCOFFObjectFile.h:81
llvm::object::XCOFFSymbolRef::isFunction
bool isFunction() const
Definition: XCOFFObjectFile.cpp:783
llvm::ArrayRef::data
const T * data() const
Definition: ArrayRef.h:162
llvm::object::XCOFFCsectAuxRef
Definition: XCOFFObjectFile.h:126
llvm::object::XCOFFSymbolRef
Definition: XCOFFObjectFile.h:476
llvm::object::XCOFFSectionHeader32::VirtualAddress
support::ubig32_t VirtualAddress
Definition: XCOFFObjectFile.h:76
llvm::object::XCOFFObjectFile::getSectionByNum
Expected< DataRefImpl > getSectionByNum(int16_t Num) const
Definition: XCOFFObjectFile.cpp:486
getSectionFlags
static uint32_t getSectionFlags(const MachOObjectFile &O, DataRefImpl Sec)
Definition: MachOObjectFile.cpp:176
llvm::object::XCOFFTracebackTable::isFuncNamePresent
bool isFuncNamePresent() const
Definition: XCOFFObjectFile.cpp:1117
llvm::Intrinsic::getType
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
Definition: Function.cpp:1285
llvm::object::XCOFFTracebackTable::getNumOfGPRsSaved
uint8_t getNumOfGPRsSaved() const
Definition: XCOFFObjectFile.cpp:1158
llvm::object::XCOFFObjectFile::getLogicalNumberOfRelocationEntries
Expected< uint32_t > getLogicalNumberOfRelocationEntries(const XCOFFSectionHeader32 &Sec) const
Definition: XCOFFObjectFile.cpp:647
llvm::XCOFF::N_ABS
@ N_ABS
Definition: XCOFF.h:34
SubtargetFeature.h
llvm::object::XCOFFFileAuxEnt::NameInStrTblType::Offset
support::ubig32_t Offset
Definition: XCOFFObjectFile.h:212
llvm::Triple::ArchType
ArchType
Definition: Triple.h:47
llvm::PPCISD::SC
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
Definition: PPCISelLowering.h:410
llvm::ModRefInfo::Ref
@ Ref
The access may reference the value stored in memory.
ptrdiff_t
GETVALUEWITHMASK
#define GETVALUEWITHMASK(X)
Definition: XCOFFObjectFile.cpp:899
llvm::object::XCOFFObjectFile::getStringTableEntry
Expected< StringRef > getStringTableEntry(uint32_t Offset) const
Definition: XCOFFObjectFile.cpp:174
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::object::TBVectorExt::getNumberOfVectorParms
uint8_t getNumberOfVectorParms() const
Definition: XCOFFObjectFile.cpp:913
llvm::object::XCOFFObjectFile::getAdvancedSymbolEntryAddress
static uintptr_t getAdvancedSymbolEntryAddress(uintptr_t CurrentAddress, uint32_t Distance)
Definition: XCOFFObjectFile.cpp:87
llvm::object::XCOFFTracebackTable::isFixup
bool isFixup() const
Definition: XCOFFObjectFile.cpp:1142
llvm::errorCodeToError
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
Definition: Error.cpp:87
llvm::SubtargetFeatures
Manages the enabling and disabling of subtarget specific features.
Definition: SubtargetFeature.h:183
XCOFFObjectFile.h
llvm::object::viewAs
static const T * viewAs(uintptr_t in)
Definition: XCOFFObjectFile.cpp:46
llvm::Triple::ppc64
@ ppc64
Definition: Triple.h:69
llvm::XCOFF::SymbolTableEntrySize
constexpr size_t SymbolTableEntrySize
Definition: XCOFF.h:29
in
The object format emitted by the WebAssembly backed is documented in
Definition: README.txt:11
llvm::report_fatal_error
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:140
llvm::ErrorAsOutParameter
Helper for Errors used as out-parameters.
Definition: Error.h:1060
llvm::object::object_error::parse_failed
@ parse_failed
llvm::object::XCOFFTracebackTable::isGlobalLinkage
bool isGlobalLinkage() const
Definition: XCOFFObjectFile.cpp:1081
llvm::object::DataRefImpl::p
uintptr_t p
Definition: SymbolicFile.h:39
llvm::object::XCOFFObjectFile::getSectionFlags
int32_t getSectionFlags(DataRefImpl Sec) const
Definition: XCOFFObjectFile.cpp:620
Info
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
llvm::XCOFF::N_DEBUG
@ N_DEBUG
Definition: XCOFF.h:34
llvm::object::XCOFFCsectAuxRef::isLabel
bool isLabel() const
Definition: XCOFFObjectFile.h:181
llvm::SmallString< 32 >
llvm::XCOFF::C_EXT
@ C_EXT
Definition: XCOFF.h:135
llvm::object::XCOFFTracebackTable::isLRSaved
bool isLRSaved() const
Definition: XCOFFObjectFile.cpp:1134
llvm::MachO::FileType
FileType
Defines the file type this file represents.
Definition: InterfaceFile.h:57
llvm::object::XCOFFObjectFile::checkSymbolEntryPointer
void checkSymbolEntryPointer(uintptr_t SymbolEntPtr) const
Definition: XCOFFObjectFile.cpp:570
llvm::XCOFF::NameSize
constexpr size_t NameSize
Definition: XCOFF.h:28
llvm::OutputFileType::Object
@ Object
llvm::object::SectionRef
This is a value type class that represents a single section in the list of sections in the object fil...
Definition: ObjectFile.h:80
llvm::object::XCOFFTracebackTable::isCRSaved
bool isCRSaved() const
Definition: XCOFFObjectFile.cpp:1130
llvm::object::XCOFFCsectAuxRef::getStorageMappingClass
XCOFF::StorageMappingClass getStorageMappingClass() const
Definition: XCOFFObjectFile.h:163
llvm::object::XCOFFSymbolEntry32::NameInStrTblType::Offset
support::ubig32_t Offset
Definition: XCOFFObjectFile.h:442
llvm::XCOFF::STYP_TDATA
@ STYP_TDATA
Definition: XCOFF.h:79
llvm::XCOFF::StorageClass
StorageClass
Definition: XCOFF.h:107
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition: README.txt:1411
llvm::object::XCOFFSymbolEntry64::Offset
support::ubig32_t Offset
Definition: XCOFFObjectFile.h:464
llvm::object::XCOFFTracebackTable::getNumberOfFPParms
uint8_t getNumberOfFPParms() const
Definition: XCOFFObjectFile.cpp:1167
llvm::object::FunctionSym
static const uint8_t FunctionSym
Definition: XCOFFObjectFile.cpp:26
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::object::object_error::string_table_non_null_end
@ string_table_non_null_end
llvm::object::symbol_iterator
Definition: ObjectFile.h:207
llvm::StringRef::end
iterator end() const
Definition: StringRef.h:130
getSymbolType
static std::unique_ptr< PDBSymbol > getSymbolType(const PDBSymbol &Symbol)
Definition: UDTLayout.cpp:33
llvm::XCOFF::STYP_OVRFLO
@ STYP_OVRFLO
Definition: XCOFF.h:84
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:80
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::COFF::SectionSize
@ SectionSize
Definition: COFF.h:61
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::object::XCOFFTracebackTable::hasTraceBackTableOffset
bool hasTraceBackTableOffset() const
Definition: XCOFFObjectFile.cpp:1089
llvm::XCOFF::C_HIDEXT
@ C_HIDEXT
Definition: XCOFF.h:143
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SI
StandardInstrumentations SI(Debug, VerifyEach)
base
therefore end up llgh r3 lr r0 br r14 but truncating the load would lh r3 br r14 Functions ret i64 and ought to be implemented ngr r0 br r14 but two address optimizations reverse the order of the AND and ngr r2 lgr r0 br r14 CodeGen SystemZ and ll has several examples of this Out of range displacements are usually handled by loading the full address into a register In many cases it would be better to create an anchor point instead E g i64 base
Definition: README.txt:125
llvm::object::content_iterator
Definition: SymbolicFile.h:67
llvm::XCOFF::TracebackTable::ParmTypeIsVectorBits
static constexpr uint32_t ParmTypeIsVectorBits
Definition: XCOFF.h:386
llvm::object::XCOFFSymbolRef::getSectionNumber
int16_t getSectionNumber() const
Definition: XCOFFObjectFile.h:501
llvm::object::ObjectFile::base
const uint8_t * base() const
Definition: ObjectFile.h:234
llvm::object::XCOFFStringTable
Definition: XCOFFObjectFile.h:100
llvm::DataExtractor::Cursor
A class representing a position in a DataExtractor, as well as any error encountered during extractio...
Definition: DataExtractor.h:54
llvm::XCOFF::TracebackTable::ParmTypeIsVectorFloatBit
static constexpr uint32_t ParmTypeIsVectorFloatBit
Definition: XCOFF.h:404
llvm::object::ObjectFile::createXCOFFObjectFile
static Expected< std::unique_ptr< ObjectFile > > createXCOFFObjectFile(MemoryBufferRef Object, unsigned FileType)
Definition: XCOFFObjectFile.cpp:778
llvm::XCOFF::TracebackTable::ParmTypeIsFloatingBits
static constexpr uint32_t ParmTypeIsFloatingBits
Definition: XCOFF.h:387
llvm::ArrayRef< uint8_t >
llvm::XCOFF::TracebackTable::ParmTypeIsVectorIntBit
static constexpr uint32_t ParmTypeIsVectorIntBit
Definition: XCOFF.h:403
llvm::object::XCOFFRelocation32::SymbolIndex
support::ubig32_t SymbolIndex
Definition: XCOFFObjectFile.h:248
llvm::object::section_iterator
content_iterator< SectionRef > section_iterator
Definition: ObjectFile.h:47
llvm::object::generateXCOFFFixedNameStringRef
static StringRef generateXCOFFFixedNameStringRef(const char *Name)
Definition: XCOFFObjectFile.cpp:50
llvm::object::Binary::ID_XCOFF64
@ ID_XCOFF64
Definition: Binary.h:58
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::object::XCOFFSymbolRef::getStorageClass
XCOFF::StorageClass getStorageClass() const
Definition: XCOFFObjectFile.h:517
llvm::object::ObjectFile
This class is the base class for all object file types.
Definition: ObjectFile.h:228
llvm::XCOFF::TracebackTable::ParmTypeIsVectorCharBit
static constexpr uint32_t ParmTypeIsVectorCharBit
Definition: XCOFF.h:401
llvm::object::XCOFFTracebackTable::create
static Expected< XCOFFTracebackTable > create(const uint8_t *Ptr, uint64_t &Size)
Parse an XCOFF Traceback Table from Ptr with Size bytes.
Definition: XCOFFObjectFile.cpp:990
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::object::XCOFFTracebackTable::hasControlledStorage
bool hasControlledStorage() const
Definition: XCOFFObjectFile.cpp:1097
llvm::XCOFF::TracebackTable::ParmTypeMask
static constexpr uint32_t ParmTypeMask
Definition: XCOFF.h:389
llvm::Expected::get
reference get()
Returns a reference to the stored T value.
Definition: Error.h:537
llvm::XCOFF::TracebackTable::ParmTypeIsDoubleBits
static constexpr uint32_t ParmTypeIsDoubleBits
Definition: XCOFF.h:388
llvm::XCOFF::C_WEAKEXT
@ C_WEAKEXT
Definition: XCOFF.h:136
uint32_t
llvm::object::XCOFFObjectFile::sections32
ArrayRef< XCOFFSectionHeader32 > sections32() const
Definition: XCOFFObjectFile.cpp:636
llvm::object::DataRefImpl
Definition: SymbolicFile.h:33
llvm::XCOFF::SymbolAuxType
SymbolAuxType
Definition: XCOFF.h:299
llvm::object::XCOFFFileAuxEnt::NameInStrTbl
NameInStrTblType NameInStrTbl
Definition: XCOFFObjectFile.h:217
llvm::object::TBVectorExt::getNumberOfVRSaved
uint8_t getNumberOfVRSaved() const
Definition: XCOFFObjectFile.cpp:902
llvm::object::XCOFFObjectFile::getSymbolAuxType
const XCOFF::SymbolAuxType * getSymbolAuxType(uintptr_t AuxEntryAddress) const
Definition: XCOFFObjectFile.cpp:93
llvm::XCOFF::N_UNDEF
@ N_UNDEF
Definition: XCOFF.h:34
llvm::object::XCOFFObjectFile::sections64
ArrayRef< XCOFFSectionHeader64 > sections64() const
Definition: XCOFFObjectFile.cpp:629
llvm::object::SymbolAuxTypeOffset
static const size_t SymbolAuxTypeOffset
Definition: XCOFFObjectFile.cpp:28
GETBITWITHMASK
#define GETBITWITHMASK(P, X)
Definition: XCOFFObjectFile.cpp:1067
llvm::object::XCOFFObjectFile::getNumberOfSections
uint16_t getNumberOfSections() const
Definition: XCOFFObjectFile.cpp:520
llvm::object::XCOFFTracebackTable::isAllocaUsed
bool isAllocaUsed() const
Definition: XCOFFObjectFile.cpp:1121
llvm::createStringError
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition: Error.h:1202
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::object::TBVectorExt::getVectorParmsInfoString
SmallString< 32 > getVectorParmsInfoString() const
Definition: XCOFFObjectFile.cpp:924
llvm::object::XCOFFSectionHeader32::SectionSize
support::ubig32_t SectionSize
Definition: XCOFFObjectFile.h:77
uint16_t
getFlags
static uint32_t getFlags(const Symbol *Sym)
Definition: TapiFile.cpp:28
llvm::object::XCOFFTracebackTable::getNumberOfFixedParms
uint8_t getNumberOfFixedParms() const
Definition: XCOFFObjectFile.cpp:1162
llvm::object::XCOFFTracebackTable::hasExtensionTable
bool hasExtensionTable() const
Definition: XCOFFObjectFile.cpp:1150
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::XCOFF::TracebackTable::ParmTypeIsFixedBits
static constexpr uint32_t ParmTypeIsFixedBits
Definition: XCOFF.h:385
getObject
static Error getObject(const T *&Obj, MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
Definition: COFFObjectFile.cpp:58
llvm::object::XCOFFTracebackTable::isInternalProcedure
bool isInternalProcedure() const
Definition: XCOFFObjectFile.cpp:1093
DataExtractor.h
llvm::object::XCOFFTracebackTable::getNumOfFPRsSaved
uint8_t getNumOfFPRsSaved() const
Definition: XCOFFObjectFile.cpp:1146
llvm::XCOFF::AUX_CSECT
@ AUX_CSECT
Identifies a csect auxiliary entry.
Definition: XCOFF.h:304
StringSwitch.h
llvm::object::XCOFFRelocation32
Definition: XCOFFObjectFile.h:231
llvm::object::XCOFFObjectFile::relocations
Expected< ArrayRef< XCOFFRelocation32 > > relocations(const XCOFFSectionHeader32 &) const
Definition: XCOFFObjectFile.cpp:663
llvm::XCOFF::getRelocationTypeString
StringRef getRelocationTypeString(XCOFF::RelocationType Type)
Definition: XCOFF.cpp:51
llvm::object::TBVectorExt::isVRSavedOnStack
bool isVRSavedOnStack() const
Definition: XCOFFObjectFile.cpp:906
llvm::makeArrayRef
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:476
getFeatures
static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS, ArrayRef< SubtargetSubTypeKV > ProcDesc, ArrayRef< SubtargetFeatureKV > ProcFeatures)
Definition: MCSubtargetInfo.cpp:150
llvm::object::XCOFFSymbolRef::NAME_IN_STR_TBL_MAGIC
@ NAME_IN_STR_TBL_MAGIC
Definition: XCOFFObjectFile.h:478
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:557
llvm::object::XCOFFSectionHeader64
Definition: XCOFFObjectFile.h:86
llvm::object::XCOFFSymbolEntry32::SymbolName
char SymbolName[XCOFF::NameSize]
Definition: XCOFFObjectFile.h:446
llvm::DataExtractor
Definition: DataExtractor.h:41
llvm::object::XCOFFTracebackTable::getOnConditionDirective
uint8_t getOnConditionDirective() const
Definition: XCOFFObjectFile.cpp:1125
llvm::object::Binary::ID_XCOFF32
@ ID_XCOFF32
Definition: Binary.h:57
llvm::XCOFF::STYP_DATA
@ STYP_DATA
Definition: XCOFF.h:75
GETVALUEWITHMASKSHIFT
#define GETVALUEWITHMASKSHIFT(X, S)
Definition: XCOFFObjectFile.cpp:900
llvm::COFF::isReservedSectionNumber
bool isReservedSectionNumber(int32_t SectionNumber)
Definition: COFF.h:729
llvm::XCOFF::STYP_TEXT
@ STYP_TEXT
Definition: XCOFF.h:74
llvm::object::XCOFFTracebackTable::isFloatingPointOperationLogOrAbortEnabled
bool isFloatingPointOperationLogOrAbortEnabled() const
Definition: XCOFFObjectFile.cpp:1109
llvm::XCOFF::parseParmsType
SmallString< 32 > parseParmsType(uint32_t Value, unsigned ParmsNum)
Definition: XCOFF.cpp:107
llvm::object::XCOFFSectionHeader32::PhysicalAddress
support::ubig32_t PhysicalAddress
Definition: XCOFFObjectFile.h:75
llvm::object::XCOFFSymbolRef::isCsectSymbol
bool isCsectSymbol() const
Definition: XCOFFObjectFile.cpp:817
llvm::object::XCOFFObjectFile
Definition: XCOFFObjectFile.h:265
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:165
llvm::object::XCOFFRelocation32::VirtualAddress
support::ubig32_t VirtualAddress
Definition: XCOFFObjectFile.h:247
llvm::object::XCOFFTracebackTable
This class provides methods to extract traceback table data from a buffer.
Definition: XCOFFObjectFile.h:559
llvm::object::Binary::checkOffset
static Error checkOffset(MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
Definition: Binary.h:166
llvm::StringRef::data
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:149
llvm::SmallVectorImpl< char >
llvm::object::XCOFFSymbolRef::getSymbolType
uint16_t getSymbolType() const
Definition: XCOFFObjectFile.h:503
llvm::object::SymbolRef
This is a value type class that represents a single symbol in the list of symbols in the object file.
Definition: ObjectFile.h:167
llvm::StringSwitch
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:42
llvm::object::XCOFFSymbolRef::getEntryAddress
uintptr_t getEntryAddress() const
Definition: XCOFFObjectFile.h:523
llvm::XCOFF::RelocationSerializationSize32
constexpr size_t RelocationSerializationSize32
Definition: XCOFF.h:30
llvm::XCOFF::STYP_TBSS
@ STYP_TBSS
Definition: XCOFF.h:80
llvm::object::RelocationRef
This is a value type class that represents a single relocation in the list of relocations in the obje...
Definition: ObjectFile.h:51
llvm::XCOFF::TracebackTable::ParmTypeIsVectorShortBit
static constexpr uint32_t ParmTypeIsVectorShortBit
Definition: XCOFF.h:402
getSymbolName
static StringRef getSymbolName(SymbolKind SymKind)
Definition: CodeViewDebug.cpp:2993
llvm::object::XCOFFSymbolEntry32::NameInStrTbl
NameInStrTblType NameInStrTbl
Definition: XCOFFObjectFile.h:447
llvm::StringRef::begin
iterator begin() const
Definition: StringRef.h:128
llvm::object::XCOFFFileAuxEnt
Definition: XCOFFObjectFile.h:209
llvm::XCOFF::RelocOverflow
constexpr uint16_t RelocOverflow
Definition: XCOFF.h:31
llvm::object::basic_symbol_iterator
content_iterator< BasicSymbolRef > basic_symbol_iterator
Definition: SymbolicFile.h:141
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::Optional::getValue
constexpr const T & getValue() const LLVM_LVALUE_FUNCTION
Definition: Optional.h:282
llvm::object::doesXCOFFTracebackTableBegin
bool doesXCOFFTracebackTableBegin(ArrayRef< uint8_t > Bytes)
Definition: XCOFFObjectFile.cpp:886
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58
llvm::object::XCOFFTracebackTable::hasVectorInfo
bool hasVectorInfo() const
Definition: XCOFFObjectFile.cpp:1154
llvm::object::XCOFFSectionHeader32::Flags
support::big32_t Flags
Definition: XCOFFObjectFile.h:83
llvm::object::XCOFFSymbolEntry32::NameInStrTblType::Magic
support::big32_t Magic
Definition: XCOFFObjectFile.h:441
llvm::support::endian::read16be
uint16_t read16be(const void *P)
Definition: Endian.h:383
llvm::object::XCOFFTracebackTable::getLanguageID
uint8_t getLanguageID() const
Definition: XCOFFObjectFile.cpp:1077