Go to the documentation of this file.
13 #ifndef LLVM_OBJECT_XCOFFOBJECTFILE_H
14 #define LLVM_OBJECT_XCOFFOBJECTFILE_H
60 return static_cast<const T *
>(
this)->FlagAndTDataAlignment &
65 return static_cast<const T *
>(
this)->FlagAndTDataAlignment &
251 static constexpr uint8_t SymbolTypeMask = 0x07;
252 static constexpr uint8_t SymbolAlignmentMask = 0xF8;
253 static constexpr
size_t SymbolAlignmentBitOffset = 3;
264 return Entry32 ? getSectionOrLength32() : getSectionOrLength64();
268 assert(Entry32 &&
"32-bit interface called on 64-bit object file.");
269 return Entry32->SectionOrLength;
273 assert(Entry64 &&
"64-bit interface called on 32-bit object file.");
274 return (
static_cast<uint64_t>(Entry64->SectionOrLengthHighByte) << 32) |
275 Entry64->SectionOrLengthLowByte;
278 #define GETVALUE(X) Entry32 ? Entry32->X : Entry64->X
281 return GETVALUE(ParameterHashIndex);
291 return Entry32 ?
reinterpret_cast<uintptr_t
>(Entry32)
292 :
reinterpret_cast<uintptr_t
>(Entry64);
296 return (getSymbolAlignmentAndType() & SymbolAlignmentMask) >>
297 SymbolAlignmentBitOffset;
301 return getSymbolAlignmentAndType() & SymbolTypeMask;
307 assert(Entry32 &&
"32-bit interface called on 64-bit object file.");
308 return Entry32->StabInfoIndex;
312 assert(Entry32 &&
"32-bit interface called on 64-bit object file.");
313 return Entry32->StabSectNum;
317 assert(Entry64 &&
"64-bit interface called on 32-bit object file.");
318 return Entry64->AuxType;
322 uint8_t getSymbolAlignmentAndType()
const {
323 return GETVALUE(SymbolAlignmentAndType);
328 const XCOFFCsectAuxEnt32 *Entry32 =
nullptr;
329 const XCOFFCsectAuxEnt64 *Entry64 =
nullptr;
447 const void *FileHeader =
nullptr;
448 const void *AuxiliaryHeader =
nullptr;
449 const void *SectionHeaderTable =
nullptr;
451 const void *SymbolTblPtr =
nullptr;
456 template <
typename T>
const T *sectionHeaderTable()
const;
458 size_t getFileHeaderSize()
const;
459 size_t getSectionHeaderSize()
const;
463 uintptr_t getSectionHeaderTableAddress()
const;
464 uintptr_t getEndOfSymbolTableAddress()
const;
470 const char *getSectionNameInternal(
DataRefImpl Sec)
const;
490 void checkSectionAddress(uintptr_t
Addr, uintptr_t TableAddr)
const;
497 void moveSymbolNext(
DataRefImpl &Symb)
const override;
510 void moveSectionNext(
DataRefImpl &Sec)
const override;
516 getSectionContents(
DataRefImpl Sec)
const override;
518 bool isSectionCompressed(
DataRefImpl Sec)
const override;
519 bool isSectionText(
DataRefImpl Sec)
const override;
520 bool isSectionData(
DataRefImpl Sec)
const override;
524 bool isSectionVirtual(
DataRefImpl Sec)
const override;
528 void moveRelocationNext(
DataRefImpl &Rel)
const override;
541 uint8_t getBytesInAddress()
const override;
542 StringRef getFileFormatName()
const override;
547 bool isRelocatableObject()
const override;
567 uint16_t getNumberOfSections()
const;
568 int32_t getTimeStamp()
const;
572 uint32_t getSymbolTableOffset32()
const;
573 uint64_t getSymbolTableOffset64()
const;
577 int32_t getRawNumberOfSymbolTableEntries32()
const;
580 uint32_t getLogicalNumberOfSymbolTableEntries32()
const;
582 uint32_t getNumberOfSymbolTableEntries64()
const;
586 uint32_t getNumberOfSymbolTableEntries()
const;
588 uint32_t getSymbolIndex(uintptr_t SymEntPtr)
const;
591 return reinterpret_cast<uintptr_t
>(SymbolTblPtr) +
594 uintptr_t getSymbolEntryAddressByIndex(
uint32_t SymbolTableIndex)
const;
598 uint16_t getOptionalHeaderSize()
const;
608 void checkSymbolEntryPointer(uintptr_t SymbolEntPtr)
const;
611 template <
typename T>
615 template <
typename Shdr,
typename Reloc>
629 static uintptr_t getAdvancedSymbolEntryAddress(uintptr_t CurrentAddress,
683 : OwningObjectPtr(OwningObjectPtr) {
684 assert(OwningObjectPtr &&
"OwningObjectPtr cannot be nullptr!");
686 "Symbol table entry pointer cannot be nullptr!");
688 if (OwningObjectPtr->
is64Bit())
703 #define GETVALUE(X) Entry32 ? Entry32->X : Entry64->X
711 "This interface is for C_FILE only.");
712 return GETVALUE(CFileLanguageIdAndTypeId.LanguageId);
717 "This interface is for C_FILE only.");
718 return GETVALUE(CFileLanguageIdAndTypeId.CpuTypeId);
728 return Entry32 ?
reinterpret_cast<uintptr_t
>(Entry32)
729 :
reinterpret_cast<uintptr_t
>(Entry64);
763 const uint8_t *
const TBPtr;
826 return TraceBackTableOffset;
831 return ControlledStorageInfoDisp;
843 #endif // LLVM_OBJECT_XCOFFOBJECTFILE_H
support::ubig16_t LineNumHi
support::ubig16_t TypeChkSectNum
bool isInterruptHandler() const
XCOFF::StorageMappingClass StorageMappingClass
uint16_t getTypeChkSectNum() const
support::big32_t SymIdxOfNextBeyond
XCOFF::StorageClass StorageClass
This is an optimization pass for GlobalISel generic memory operations.
support::ubig32_t ParameterHashIndex
const Optional< uint8_t > & getExtensionTable() const
support::big16_t SectionNumber
bool hasParmsOnStack() const
Expected< XCOFFCsectAuxRef > getXCOFFCsectAuxRef() const
Expected< StringRef > getName() const
@ XTY_LD
Label definition. Defines an entry point to an initialized csect.
support::ubig16_t LineNumLo
static bool is64Bit(const char *name)
AddressType VirtualAddress
bool isFloatingPointPresent() const
support::big32_t SymIdxOfNextBeyond
uint8_t getVersion() const
bool isBackChainStored() const
support::ubig64_t LengthOfSectionPortion
XCOFF::SymbolAuxType AuxType
bool isOutOfLineEpilogOrPrologue() const
The instances of the Type class are immutable: once they are created, they are never changed.
support::ubig32_t LengthOfSectionPortion
static constexpr uint8_t XR_FIXUP_INDICATOR_MASK
support::ubig32_t NumberOfRelocEnt
bool hasVMXInstruction() const
static constexpr uint8_t XR_SIGN_INDICATOR_MASK
char Name[XCOFF::NameSize+XCOFF::FileNamePadSize]
uint32_t getParameterHashIndex() const
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
const Optional< StringRef > & getFunctionName() const
Tagged union holding either a T or a Error.
uint8_t getNumberOfAuxEntries() const
support::ubig64_t OffsetToExceptionTbl
uint8_t getSymbolType() const
support::ubig16_t SymbolType
support::ubig32_t SectionLength
uint64_t getSectionOrLength() const
const Optional< uint8_t > & getAllocaRegister() const
const Optional< uint32_t > & getTraceBackTableOffset() const
uint64_t getValue64() const
static uint32_t getSectionFlags(const MachOObjectFile &O, DataRefImpl Sec)
bool isFuncNamePresent() const
support::big16_t SectionNumber
uint8_t getNumOfGPRsSaved() const
const Optional< uint32_t > & getHandlerMask() const
XCOFF::SymbolAuxType AuxType
support::ubig32_t SizeOfFunction
@ Ref
The access may reference the value stored in memory.
SmallString< 32 > getVectorParmsInfo() const
uint8_t getNumberOfVectorParms() const
support::ubig16_t NumberOfLineNum
Manages the enabling and disabling of subtarget specific features.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
uint16_t getStabSectNum32() const
XCOFFCsectAuxRef(const XCOFFCsectAuxEnt64 *Entry64)
uint8_t getCPUTypeIddForCFile() const
support::ubig32_t SectionOrLengthLowByte
constexpr size_t SymbolTableEntrySize
bool isGlobalLinkage() const
const void * getPointerToSymbolTable() const
support::ubig64_t NumberOfRelocEnt
XCOFF::RelocationType Type
support::ubig16_t StabSectNum
XCOFFSymbolRef(DataRefImpl SymEntDataRef, const XCOFFObjectFile *OwningObjectPtr)
uintptr_t getSymbolByIndex(uint32_t Idx) const
StorageMappingClass
Storage Mapping Class definitions.
XCOFF::SymbolAuxType getAuxType64() const
FileType
Defines the file type this file represents.
constexpr size_t NameSize
support::ubig16_t NumberOfRelocEnt
XCOFF::StorageMappingClass getStorageMappingClass() const
static Expected< TBVectorExt > create(StringRef TBvectorStrRef)
uint8_t SymbolAlignmentAndType
uint16_t getAlignmentLog2() const
uint8_t ReservedZeros1[2]
bar al al movzbl eax ret Missed when stored in a memory object
uint8_t getNumberOfFPParms() const
const Optional< TBVectorExt > & getVectorExt() const
bool isRelocationSigned() const
static std::unique_ptr< PDBSymbol > getSymbolType(const PDBSymbol &Symbol)
uint8_t getRelocatedLength() const
uint8_t NumberOfAuxEntries
support::ubig32_t SectionOrLength
bool hasTraceBackTableOffset() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
support::ubig64_t PtrToLineNum
int16_t getSectionNumber() const
constexpr size_t FileNamePadSize
XCOFFCsectAuxRef(const XCOFFCsectAuxEnt32 *Entry32)
uint8_t getLanguageIdForCFile() const
support::ubig32_t LineNum
support::ubig32_t ParameterHashIndex
static Expected< std::unique_ptr< ObjectFile > > createXCOFFObjectFile(MemoryBufferRef Object, unsigned FileType)
CFileLanguageIdAndTypeIdType CFileLanguageIdAndTypeId
bool isFixupIndicated() const
XCOFF::StorageClass StorageClass
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
XCOFF::StorageMappingClass StorageMappingClass
StringRef - Represent a constant reference to a string, i.e.
XCOFF::StorageClass getStorageClass() const
This class is the base class for all object file types.
static Expected< XCOFFTracebackTable > create(const uint8_t *Ptr, uint64_t &Size)
Parse an XCOFF Traceback Table from Ptr with Size bytes.
bool hasControlledStorage() const
support::ubig32_t SymbolIndex
const Optional< SmallString< 32 > > & getParmsType() const
support::ubig16_t SymbolType
uint8_t SymbolAlignmentAndType
NameInStrTblType NameInStrTbl
uint8_t getNumberOfVRSaved() const
static bool classof(const Binary *B)
support::big32_t SymIdxOfNextBeyond
const Optional< uint32_t > & getNumOfCtlAnchors()
uintptr_t getEntryAddress() const
uint32_t getValue32() const
bool isAllocaUsed() const
support::ubig32_t SizeOfFunction
XCOFF::SymbolAuxType AuxType
static uint32_t getFlags(const Symbol *Sym)
uint8_t getNumberOfFixedParms() const
bool hasExtensionTable() const
Lightweight error class with error context and mandatory checking.
bool isInternalProcedure() const
uint8_t getNumOfFPRsSaved() const
static bool isDebugSection(const SectionBase &Sec)
uint8_t ReservedZeros2[12]
CFileLanguageIdAndTypeIdType CFileLanguageIdAndTypeId
uint32_t getStabInfoIndex32() const
XCOFF::SymbolAuxType AuxType
bool isVRSavedOnStack() const
static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS, ArrayRef< SubtargetSubTypeKV > ProcDesc, ArrayRef< SubtargetFeatureKV > ProcFeatures)
const Optional< SmallVector< uint32_t, 8 > > & getControlledStorageInfoDisp()
XCOFF::SymbolAuxType AuxType
support::ubig32_t PtrToLineNum
char SymbolName[XCOFF::NameSize]
uint8_t getOnConditionDirective() const
support::ubig16_t TypeChkSectNum
XCOFF::CFileStringType Type
static unsigned getSymbolSectionID(const ObjectFile &O, SymbolRef Sym)
bool isReservedSectionNumber(int32_t SectionNumber)
bool isFloatingPointOperationLogOrAbortEnabled() const
const XCOFFSymbolEntry32 * getSymbol32()
support::ubig32_t SizeOfFunction
bool isCsectSymbol() const
static constexpr uint8_t XR_BIASED_LENGTH_MASK
This class provides methods to extract traceback table data from a buffer.
support::ubig32_t StabInfoIndex
uint16_t getSymbolType() const
This is a value type class that represents a single symbol in the list of symbols in the object file.
uintptr_t getEntryAddress() const
XCOFF::SymbolAuxType AuxType
uint32_t getSectionOrLength32() const
uint64_t getValue() const
uint64_t getSectionOrLength64() const
static StringRef getSymbolName(SymbolKind SymKind)
NameInStrTblType NameInStrTbl
const XCOFFSymbolEntry64 * getSymbol64()
support::ubig32_t OffsetToExceptionTbl
support::ubig32_t SectionOrLengthHighByte
bool doesXCOFFTracebackTableBegin(ArrayRef< uint8_t > Bytes)
bool hasVectorInfo() const
uint8_t NumberOfAuxEntries
uint8_t getLanguageID() const