LLVM  9.0.0svn
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/ArrayRef.h"
16 #include "llvm/Support/Endian.h"
19 #include <cstddef>
20 #include <cstring>
21 
22 namespace llvm {
23 namespace object {
24 
25 // Checks that [Ptr, Ptr + Size) bytes fall inside the memory buffer
26 // 'M'. Returns a pointer to the underlying object on success.
27 template <typename T>
28 static Expected<const T *> getObject(MemoryBufferRef M, const void *Ptr,
29  const uint64_t Size = sizeof(T)) {
30  uintptr_t Addr = uintptr_t(Ptr);
31  if (std::error_code EC = Binary::checkOffset(M, Addr, Size))
32  return errorCodeToError(EC);
33  return reinterpret_cast<const T *>(Addr);
34 }
35 
36 static uintptr_t getWithOffset(uintptr_t Base, ptrdiff_t Offset) {
37  return reinterpret_cast<uintptr_t>(reinterpret_cast<const char *>(Base) +
38  Offset);
39 }
40 
41 template <typename T> static const T *viewAs(uintptr_t in) {
42  return reinterpret_cast<const T *>(in);
43 }
44 
45 static StringRef generateStringRef(const char *Name, uint64_t Size) {
46  auto NulCharPtr = static_cast<const char *>(memchr(Name, '\0', Size));
47  return NulCharPtr ? StringRef(Name, NulCharPtr - Name)
48  : StringRef(Name, Size);
49 }
50 
51 void XCOFFObjectFile::checkSectionAddress(uintptr_t Addr,
52  uintptr_t TableAddress) const {
53  if (Addr < TableAddress)
54  report_fatal_error("Section header outside of section header table.");
55 
56  uintptr_t Offset = Addr - TableAddress;
57  if (Offset >= getSectionHeaderSize() * getNumberOfSections())
58  report_fatal_error("Section header outside of section header table.");
59 
60  if (Offset % getSectionHeaderSize() != 0)
62  "Section header pointer does not point to a valid section header.");
63 }
64 
66 XCOFFObjectFile::toSection32(DataRefImpl Ref) const {
67  assert(!is64Bit() && "32-bit interface called on 64-bit object file.");
68 #ifndef NDEBUG
69  checkSectionAddress(Ref.p, getSectionHeaderTableAddress());
70 #endif
71  return viewAs<XCOFFSectionHeader32>(Ref.p);
72 }
73 
75 XCOFFObjectFile::toSection64(DataRefImpl Ref) const {
76  assert(is64Bit() && "64-bit interface called on a 32-bit object file.");
77 #ifndef NDEBUG
78  checkSectionAddress(Ref.p, getSectionHeaderTableAddress());
79 #endif
80  return viewAs<XCOFFSectionHeader64>(Ref.p);
81 }
82 
84  assert(!is64Bit() && "Symbol table support not implemented for 64-bit.");
85  assert(Ref.p != 0 && "Symbol table pointer can not be nullptr!");
86  auto SymEntPtr = viewAs<XCOFFSymbolEntry>(Ref.p);
87  return SymEntPtr;
88 }
89 
90 const XCOFFFileHeader32 *XCOFFObjectFile::fileHeader32() const {
91  assert(!is64Bit() && "32-bit interface called on 64-bit object file.");
92  return static_cast<const XCOFFFileHeader32 *>(FileHeader);
93 }
94 
95 const XCOFFFileHeader64 *XCOFFObjectFile::fileHeader64() const {
96  assert(is64Bit() && "64-bit interface called on a 32-bit object file.");
97  return static_cast<const XCOFFFileHeader64 *>(FileHeader);
98 }
99 
100 const XCOFFSectionHeader32 *
101 XCOFFObjectFile::sectionHeaderTable32() const {
102  assert(!is64Bit() && "32-bit interface called on 64-bit object file.");
103  return static_cast<const XCOFFSectionHeader32 *>(SectionHeaderTable);
104 }
105 
106 const XCOFFSectionHeader64 *
107 XCOFFObjectFile::sectionHeaderTable64() const {
108  assert(is64Bit() && "64-bit interface called on a 32-bit object file.");
109  return static_cast<const XCOFFSectionHeader64 *>(SectionHeaderTable);
110 }
111 
113  const XCOFFSymbolEntry *SymEntPtr = toSymbolEntry(Symb);
114  SymEntPtr += SymEntPtr->NumberOfAuxEntries + 1;
115  Symb.p = reinterpret_cast<uintptr_t>(SymEntPtr);
116 }
117 
119  const XCOFFSymbolEntry *SymEntPtr = toSymbolEntry(Symb);
120 
123 
124  // A storage class value with the high-order bit on indicates that the name is
125  // a symbolic debugger stabstring.
126  if (SymEntPtr->StorageClass & 0x80)
127  return StringRef("Unimplemented Debug Name");
128 
129  uint32_t Offset = SymEntPtr->NameInStrTbl.Offset;
130  // The byte offset is relative to the start of the string table
131  // or .debug section. A byte offset value of 0 is a null or zero-length symbol
132  // name. A byte offset in the range 1 to 3 (inclusive) points into the length
133  // field; as a soft-error recovery mechanism, we treat such cases as having an
134  // offset of 0.
135  if (Offset < 4)
136  return StringRef(nullptr, 0);
137 
138  if (StringTable.Data != nullptr && StringTable.Size > Offset)
139  return (StringTable.Data + Offset);
140 
141  return make_error<GenericBinaryError>("Symbol Name parse failed",
143 }
144 
146  uint64_t Result = 0;
147  llvm_unreachable("Not yet implemented!");
148  return Result;
149 }
150 
152  return toSymbolEntry(Symb)->Value;
153 }
154 
156  uint64_t Result = 0;
157  llvm_unreachable("Not yet implemented!");
158  return Result;
159 }
160 
163  llvm_unreachable("Not yet implemented!");
164  return SymbolRef::ST_Other;
165 }
166 
169  const XCOFFSymbolEntry *SymEntPtr = toSymbolEntry(Symb);
170  int16_t SectNum = SymEntPtr->SectionNumber;
171 
172  if (isReservedSectionNumber(SectNum))
173  return section_end();
174 
175  Expected<DataRefImpl> ExpSec = getSectionByNum(SectNum);
176  if (!ExpSec)
177  return ExpSec.takeError();
178 
179  return section_iterator(SectionRef(ExpSec.get(), this));
180 }
181 
183  const char *Ptr = reinterpret_cast<const char *>(Sec.p);
184  Sec.p = reinterpret_cast<uintptr_t>(Ptr + getSectionHeaderSize());
185 }
186 
188  return generateStringRef(getSectionNameInternal(Sec), XCOFF::SectionNameSize);
189 }
190 
192  // Avoid ternary due to failure to convert the ubig32_t value to a unit64_t
193  // with MSVC.
194  if (is64Bit())
195  return toSection64(Sec)->VirtualAddress;
196 
197  return toSection32(Sec)->VirtualAddress;
198 }
199 
201  // Section numbers in XCOFF are numbered beginning at 1. A section number of
202  // zero is used to indicate that a symbol is being imported or is undefined.
203  if (is64Bit())
204  return toSection64(Sec) - sectionHeaderTable64() + 1;
205  else
206  return toSection32(Sec) - sectionHeaderTable32() + 1;
207 }
208 
210  // Avoid ternary due to failure to convert the ubig32_t value to a unit64_t
211  // with MSVC.
212  if (is64Bit())
213  return toSection64(Sec)->SectionSize;
214 
215  return toSection32(Sec)->SectionSize;
216 }
217 
220  llvm_unreachable("Not yet implemented!");
221 }
222 
224  uint64_t Result = 0;
225  llvm_unreachable("Not yet implemented!");
226  return Result;
227 }
228 
230  bool Result = false;
231  llvm_unreachable("Not yet implemented!");
232  return Result;
233 }
234 
236  return getSectionFlags(Sec) & XCOFF::STYP_TEXT;
237 }
238 
240  uint32_t Flags = getSectionFlags(Sec);
241  return Flags & (XCOFF::STYP_DATA | XCOFF::STYP_TDATA);
242 }
243 
245  uint32_t Flags = getSectionFlags(Sec);
246  return Flags & (XCOFF::STYP_BSS | XCOFF::STYP_TBSS);
247 }
248 
250  bool Result = false;
251  llvm_unreachable("Not yet implemented!");
252  return Result;
253 }
254 
256  llvm_unreachable("Not yet implemented!");
258 }
259 
261  llvm_unreachable("Not yet implemented!");
263 }
264 
266  llvm_unreachable("Not yet implemented!");
267  return;
268 }
269 
271  llvm_unreachable("Not yet implemented!");
272  uint64_t Result = 0;
273  return Result;
274 }
275 
277  llvm_unreachable("Not yet implemented!");
278  return symbol_iterator(SymbolRef());
279 }
280 
282  llvm_unreachable("Not yet implemented!");
283  uint64_t Result = 0;
284  return Result;
285 }
286 
288  DataRefImpl Rel, SmallVectorImpl<char> &Result) const {
289  llvm_unreachable("Not yet implemented!");
290  return;
291 }
292 
294  uint32_t Result = 0;
295  llvm_unreachable("Not yet implemented!");
296  return Result;
297 }
298 
300  assert(!is64Bit() && "64-bit support not implemented yet.");
301  DataRefImpl SymDRI;
302  SymDRI.p = reinterpret_cast<uintptr_t>(SymbolTblPtr);
303  return basic_symbol_iterator(SymbolRef(SymDRI, this));
304 }
305 
307  assert(!is64Bit() && "64-bit support not implemented yet.");
308  DataRefImpl SymDRI;
309  SymDRI.p = reinterpret_cast<uintptr_t>(
310  SymbolTblPtr + getLogicalNumberOfSymbolTableEntries32());
311  return basic_symbol_iterator(SymbolRef(SymDRI, this));
312 }
313 
315  DataRefImpl DRI;
316  DRI.p = getSectionHeaderTableAddress();
317  return section_iterator(SectionRef(DRI, this));
318 }
319 
321  DataRefImpl DRI;
322  DRI.p = getWithOffset(getSectionHeaderTableAddress(),
323  getNumberOfSections() * getSectionHeaderSize());
324  return section_iterator(SectionRef(DRI, this));
325 }
326 
327 uint8_t XCOFFObjectFile::getBytesInAddress() const { return is64Bit() ? 8 : 4; }
328 
330  return is64Bit() ? "aix5coff64-rs6000" : "aixcoff-rs6000";
331 }
332 
334  return is64Bit() ? Triple::ppc64 : Triple::ppc;
335 }
336 
338  llvm_unreachable("Not yet implemented!");
339  return SubtargetFeatures();
340 }
341 
343  bool Result = false;
344  llvm_unreachable("Not yet implemented!");
345  return Result;
346 }
347 
349  // TODO FIXME Should get from auxiliary_header->o_entry when support for the
350  // auxiliary_header is added.
351  return 0;
352 }
353 
354 size_t XCOFFObjectFile::getFileHeaderSize() const {
355  return is64Bit() ? sizeof(XCOFFFileHeader64) : sizeof(XCOFFFileHeader32);
356 }
357 
358 size_t XCOFFObjectFile::getSectionHeaderSize() const {
359  return is64Bit() ? sizeof(XCOFFSectionHeader64) :
360  sizeof(XCOFFSectionHeader32);
361 }
362 
364  return Binary::ID_XCOFF64 == getType();
365 }
366 
367 uint16_t XCOFFObjectFile::getMagic() const {
368  return is64Bit() ? fileHeader64()->Magic : fileHeader32()->Magic;
369 }
370 
371 Expected<DataRefImpl> XCOFFObjectFile::getSectionByNum(int16_t Num) const {
372  if (Num <= 0 || Num > getNumberOfSections())
374 
375  DataRefImpl DRI;
376  DRI.p = getWithOffset(getSectionHeaderTableAddress(),
377  getSectionHeaderSize() * (Num - 1));
378  return DRI;
379 }
380 
383  assert(!is64Bit() && "Symbol table support not implemented for 64-bit.");
384  int16_t SectionNum = SymEntPtr->SectionNumber;
385 
386  switch (SectionNum) {
387  case XCOFF::N_DEBUG:
388  return "N_DEBUG";
389  case XCOFF::N_ABS:
390  return "N_ABS";
391  case XCOFF::N_UNDEF:
392  return "N_UNDEF";
393  default:
394  Expected<DataRefImpl> SecRef = getSectionByNum(SectionNum);
395  if (SecRef)
396  return generateStringRef(getSectionNameInternal(SecRef.get()),
398  return SecRef.takeError();
399  }
400 }
401 
402 bool XCOFFObjectFile::isReservedSectionNumber(int16_t SectionNumber) {
403  return (SectionNumber <= 0 && SectionNumber >= -2);
404 }
405 
407  return is64Bit() ? fileHeader64()->NumberOfSections
408  : fileHeader32()->NumberOfSections;
409 }
410 
412  return is64Bit() ? fileHeader64()->TimeStamp : fileHeader32()->TimeStamp;
413 }
414 
416  return is64Bit() ? fileHeader64()->AuxHeaderSize
417  : fileHeader32()->AuxHeaderSize;
418 }
419 
421  return fileHeader32()->SymbolTableOffset;
422 }
423 
425  // As far as symbol table size is concerned, if this field is negative it is
426  // to be treated as a 0. However since this field is also used for printing we
427  // don't want to truncate any negative values.
428  return fileHeader32()->NumberOfSymTableEntries;
429 }
430 
432  return (fileHeader32()->NumberOfSymTableEntries >= 0
433  ? fileHeader32()->NumberOfSymTableEntries
434  : 0);
435 }
436 
438  return fileHeader64()->SymbolTableOffset;
439 }
440 
442  return fileHeader64()->NumberOfSymTableEntries;
443 }
444 
445 uint16_t XCOFFObjectFile::getFlags() const {
446  return is64Bit() ? fileHeader64()->Flags : fileHeader32()->Flags;
447 }
448 
449 const char *XCOFFObjectFile::getSectionNameInternal(DataRefImpl Sec) const {
450  return is64Bit() ? toSection64(Sec)->Name : toSection32(Sec)->Name;
451 }
452 
453 uintptr_t XCOFFObjectFile::getSectionHeaderTableAddress() const {
454  return reinterpret_cast<uintptr_t>(SectionHeaderTable);
455 }
456 
457 int32_t XCOFFObjectFile::getSectionFlags(DataRefImpl Sec) const {
458  return is64Bit() ? toSection64(Sec)->Flags : toSection32(Sec)->Flags;
459 }
460 
461 XCOFFObjectFile::XCOFFObjectFile(unsigned int Type, MemoryBufferRef Object)
462  : ObjectFile(Type, Object) {
463  assert(Type == Binary::ID_XCOFF32 || Type == Binary::ID_XCOFF64);
464 }
465 
467  assert(is64Bit() && "64-bit interface called for non 64-bit file.");
468  const XCOFFSectionHeader64 *TablePtr = sectionHeaderTable64();
469  return ArrayRef<XCOFFSectionHeader64>(TablePtr,
470  TablePtr + getNumberOfSections());
471 }
472 
474  assert(!is64Bit() && "32-bit interface called for non 32-bit file.");
475  const XCOFFSectionHeader32 *TablePtr = sectionHeaderTable32();
476  return ArrayRef<XCOFFSectionHeader32>(TablePtr,
477  TablePtr + getNumberOfSections());
478 }
479 
481 XCOFFObjectFile::parseStringTable(const XCOFFObjectFile *Obj, uint64_t Offset) {
482  // If there is a string table, then the buffer must contain at least 4 bytes
483  // for the string table's size. Not having a string table is not an error.
484  if (auto EC = Binary::checkOffset(
485  Obj->Data, reinterpret_cast<uintptr_t>(Obj->base() + Offset), 4))
486  return XCOFFStringTable{0, nullptr};
487 
488  // Read the size out of the buffer.
490 
491  // If the size is less then 4, then the string table is just a size and no
492  // string data.
493  if (Size <= 4)
494  return XCOFFStringTable{4, nullptr};
495 
496  auto StringTableOrErr =
497  getObject<char>(Obj->Data, Obj->base() + Offset, Size);
498  if (Error E = StringTableOrErr.takeError())
499  return std::move(E);
500 
501  const char *StringTablePtr = StringTableOrErr.get();
502  if (StringTablePtr[Size - 1] != '\0')
504 
505  return XCOFFStringTable{Size, StringTablePtr};
506 }
507 
509 XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) {
510  // Can't use make_unique because of the private constructor.
511  std::unique_ptr<XCOFFObjectFile> Obj;
512  Obj.reset(new XCOFFObjectFile(Type, MBR));
513 
514  uint64_t CurOffset = 0;
515  const auto *Base = Obj->base();
516  MemoryBufferRef Data = Obj->Data;
517 
518  // Parse file header.
519  auto FileHeaderOrErr =
520  getObject<void>(Data, Base + CurOffset, Obj->getFileHeaderSize());
521  if (Error E = FileHeaderOrErr.takeError())
522  return std::move(E);
523  Obj->FileHeader = FileHeaderOrErr.get();
524 
525  CurOffset += Obj->getFileHeaderSize();
526  // TODO FIXME we don't have support for an optional header yet, so just skip
527  // past it.
528  CurOffset += Obj->getOptionalHeaderSize();
529 
530  // Parse the section header table if it is present.
531  if (Obj->getNumberOfSections()) {
532  auto SecHeadersOrErr = getObject<void>(Data, Base + CurOffset,
533  Obj->getNumberOfSections() *
534  Obj->getSectionHeaderSize());
535  if (Error E = SecHeadersOrErr.takeError())
536  return std::move(E);
537  Obj->SectionHeaderTable = SecHeadersOrErr.get();
538  }
539 
540  // 64-bit object supports only file header and section headers for now.
541  if (Obj->is64Bit())
542  return std::move(Obj);
543 
544  // If there is no symbol table we are done parsing the memory buffer.
545  if (Obj->getLogicalNumberOfSymbolTableEntries32() == 0)
546  return std::move(Obj);
547 
548  // Parse symbol table.
549  CurOffset = Obj->fileHeader32()->SymbolTableOffset;
550  uint64_t SymbolTableSize = (uint64_t)(sizeof(XCOFFSymbolEntry)) *
551  Obj->getLogicalNumberOfSymbolTableEntries32();
552  auto SymTableOrErr =
553  getObject<XCOFFSymbolEntry>(Data, Base + CurOffset, SymbolTableSize);
554  if (Error E = SymTableOrErr.takeError())
555  return std::move(E);
556  Obj->SymbolTblPtr = SymTableOrErr.get();
557  CurOffset += SymbolTableSize;
558 
559  // Parse String table.
560  Expected<XCOFFStringTable> StringTableOrErr =
561  parseStringTable(Obj.get(), CurOffset);
562  if (Error E = StringTableOrErr.takeError())
563  return std::move(E);
564  Obj->StringTable = StringTableOrErr.get();
565 
566  return std::move(Obj);
567 }
568 
571  unsigned FileType) {
572  return XCOFFObjectFile::create(FileType, MemBufRef);
573 }
574 
577 }
578 
581 }
582 
583 } // namespace object
584 } // namespace llvm
void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
Expected< StringRef > getSymbolSectionName(const XCOFFSymbolEntry *SymEntPtr) const
uint64_t getRelocationType(DataRefImpl Rel) const override
bool isSectionData(DataRefImpl Sec) const override
friend class SymbolRef
Definition: ObjectFile.h:244
void moveRelocationNext(DataRefImpl &Rel) const override
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:139
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Expected< section_iterator > getSymbolSection(DataRefImpl Symb) const override
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
friend class SectionRef
Definition: ObjectFile.h:258
basic_symbol_iterator symbol_end() const override
static std::error_code checkOffset(MemoryBufferRef M, uintptr_t Addr, const uint64_t Size)
Definition: Binary.h:157
support::big32_t NumberOfSymTableEntries
uint64_t getSymbolValueImpl(DataRefImpl Symb) const override
static StringRef generateStringRef(const char *Name, uint64_t Size)
const uint8_t * base() const
Definition: ObjectFile.h:232
Error takeError()
Take ownership of the stored error.
Definition: Error.h:552
Expected< uint64_t > getStartAddress() const override
static Expected< std::unique_ptr< ObjectFile > > createXCOFFObjectFile(MemoryBufferRef Object, unsigned FileType)
char Name[XCOFF::SectionNameSize]
Expected< ArrayRef< uint8_t > > getSectionContents(DataRefImpl Sec) const override
uint32_t getSymbolFlags(DataRefImpl Symb) const override
ArrayRef< XCOFFSectionHeader64 > sections64() const
void moveSectionNext(DataRefImpl &Sec) const override
relocation_iterator section_rel_end(DataRefImpl Sec) const override
uint32_t getLogicalNumberOfSymbolTableEntries32() const
uint32_t read32be(const void *P)
Definition: Endian.h:386
const XCOFFSymbolEntry * toSymbolEntry(DataRefImpl Ref) const
Expected< SymbolRef::Type > getSymbolType(DataRefImpl Symb) const override
static Expected< const T * > getObject(MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
The access may reference the value stored in memory.
uint64_t getRelocationOffset(DataRefImpl Rel) const override
Tagged union holding either a T or a Error.
Definition: CachePruning.h:22
section_iterator section_begin() const override
int32_t getRawNumberOfSymbolTableEntries32() const
content_iterator< SectionRef > section_iterator
Definition: ObjectFile.h:48
uint16_t getOptionalHeaderSize() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
char SymbolName[XCOFF::SymbolNameSize]
Expected< StringRef > getSymbolName(DataRefImpl Symb) const override
SubtargetFeatures getFeatures() const override
uint64_t getSectionAlignment(DataRefImpl Sec) const override
support::ubig16_t NumberOfSections
void moveSymbolNext(DataRefImpl &Symb) const override
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
uint64_t getSectionAddress(DataRefImpl Sec) const override
unsigned int getType() const
Definition: Binary.h:97
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
Definition: Error.cpp:87
uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override
uint32_t getNumberOfSymbolTableEntries64() const
bool isSectionText(DataRefImpl Sec) const override
relocation_iterator section_rel_begin(DataRefImpl Sec) const override
Triple::ArchType getArch() const override
XCOFF::StorageClass StorageClass
basic_symbol_iterator symbol_begin() const override
static const T * viewAs(uintptr_t in)
Expected< uint64_t > getSymbolAddress(DataRefImpl Symb) const override
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint64_t getSectionSize(DataRefImpl Sec) const override
uint8_t getBytesInAddress() const override
The number of bytes used to represent an address in this object file format.
section_iterator section_end() const override
FileType
Defines the file type this file represents.
Definition: InterfaceFile.h:65
friend class RelocationRef
Definition: ObjectFile.h:283
support::ubig64_t SymbolTableOffset
bool isSectionCompressed(DataRefImpl Sec) const override
support::ubig16_t NumberOfSections
reference get()
Returns a reference to the stored T value.
Definition: Error.h:532
bool isSectionBSS(DataRefImpl Sec) const override
content_iterator< BasicSymbolRef > basic_symbol_iterator
Definition: SymbolicFile.h:138
bool isRelocatableObject() const override
True if this is a relocatable object (.o/.obj).
MemoryBufferRef Data
Definition: Binary.h:37
Manages the enabling and disabling of subtarget specific features.
uint64_t getSymbolTableOffset64() const
uint32_t getSymbolTableOffset32() const
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override
Expected< StringRef > getSectionName(DataRefImpl Sec) const override
uint32_t Size
Definition: Profile.cpp:46
static uintptr_t getWithOffset(uintptr_t Base, ptrdiff_t Offset)
uint64_t getSectionIndex(DataRefImpl Sec) const override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
support::ubig32_t SymbolTableOffset
StringRef getFileFormatName() const override
char Name[XCOFF::SectionNameSize]
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
content_iterator< RelocationRef > relocation_iterator
Definition: ObjectFile.h:77
support::ubig32_t NumberOfSymTableEntries
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
bool isSectionVirtual(DataRefImpl Sec) const override
ArrayRef< XCOFFSectionHeader32 > sections32() const