return N;
}
-uint64_t Defined::getFileOff() {
- switch (kind()) {
- case DefinedImportDataKind:
- return cast<DefinedImportData>(this)->getFileOff();
- case DefinedImportThunkKind:
- return cast<DefinedImportThunk>(this)->getFileOff();
- case DefinedLocalImportKind:
- return cast<DefinedLocalImport>(this)->getFileOff();
- case DefinedCommonKind:
- return cast<DefinedCommon>(this)->getFileOff();
- case DefinedRegularKind:
- return cast<DefinedRegular>(this)->getFileOff();
-
- case DefinedBitcodeKind:
- llvm_unreachable("There is no file offset for a bitcode symbol.");
- case DefinedAbsoluteKind:
- llvm_unreachable("Cannot get a file offset for an absolute symbol.");
- case DefinedRelativeKind:
- llvm_unreachable("Cannot get a file offset for a relative symbol.");
- case LazyKind:
- case UndefinedKind:
- llvm_unreachable("Cannot get a file offset for an undefined symbol.");
- }
- llvm_unreachable("unknown symbol kind");
-}
-
COFFSymbolRef DefinedCOFF::getCOFFSymbol() {
size_t SymSize = File->getCOFFObj()->getSymbolTableEntrySize();
if (SymSize == sizeof(coff_symbol16))
// writer sets and uses RVAs.
uint64_t getRVA();
- // Returns the file offset of this symbol in the final executable.
- // The writer uses this information to apply relocations.
- uint64_t getFileOff();
-
// Returns the RVA relative to the beginning of the output section.
// Used to implement SECREL relocation type.
uint64_t getSecrel();