diff options
Diffstat (limited to 'ELF/Config.h')
-rw-r--r-- | ELF/Config.h | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/ELF/Config.h b/ELF/Config.h index 23627dd812db..74c325cb7cb1 100644 --- a/ELF/Config.h +++ b/ELF/Config.h @@ -24,7 +24,6 @@ namespace lld { namespace elf { class InputFile; -struct Symbol; enum ELFKind { ELFNoneKind, @@ -44,7 +43,10 @@ enum class DiscardPolicy { Default, All, Locals, None }; enum class StripPolicy { None, All, Debug }; // For --unresolved-symbols. -enum class UnresolvedPolicy { ReportError, Warn, WarnAll, Ignore, IgnoreAll }; +enum class UnresolvedPolicy { ReportError, Warn, Ignore, IgnoreAll }; + +// For --orphan-handling. +enum class OrphanHandlingPolicy { Place, Warn, Error }; // For --sort-section and linkerscript sorting rules. enum class SortSectionPolicy { Default, None, Alignment, Name, Priority }; @@ -67,21 +69,15 @@ struct VersionDefinition { size_t NameOff = 0; // Offset in the string table }; -// Structure for mapping renamed symbols -struct RenamedSymbol { - Symbol *Target; - uint8_t OriginalBinding; -}; - // This struct contains the global configuration for the linker. // Most fields are direct mapping from the command line options // and such fields have the same name as the corresponding options. // Most fields are initialized by the driver. struct Configuration { - InputFile *FirstElf = nullptr; uint8_t OSABI = 0; llvm::CachePruningPolicy ThinLTOCachePolicy; llvm::StringMap<uint64_t> SectionStartMap; + llvm::StringRef Chroot; llvm::StringRef DynamicLinker; llvm::StringRef Entry; llvm::StringRef Emulation; @@ -103,15 +99,18 @@ struct Configuration { std::vector<llvm::StringRef> SearchPaths; std::vector<llvm::StringRef> SymbolOrderingFile; std::vector<llvm::StringRef> Undefined; + std::vector<SymbolVersion> DynamicList; std::vector<SymbolVersion> VersionScriptGlobals; std::vector<SymbolVersion> VersionScriptLocals; std::vector<uint8_t> BuildIdVector; - llvm::MapVector<Symbol *, RenamedSymbol> RenamedSymbols; bool AllowMultipleDefinition; + bool AndroidPackDynRelocs = false; + bool ARMHasBlx = false; + bool ARMHasMovtMovw = false; + bool ARMJ1J2BranchEncoding = false; bool AsNeeded = false; bool Bsymbolic; bool BsymbolicFunctions; - bool ColorDiagnostics = false; bool CompressDebugSections; bool DefineCommon; bool Demangle = true; @@ -120,14 +119,19 @@ struct Configuration { bool EmitRelocs; bool EnableNewDtags; bool ExportDynamic; - bool FatalWarnings; + bool FixCortexA53Errata843419; bool GcSections; bool GdbIndex; - bool GnuHash; + bool GnuHash = false; + bool HasDynamicList = false; + bool HasDynSymTab; bool ICF; + bool ICFData; + bool MergeArmExidx; bool MipsN32Abi = false; bool NoGnuUnique; bool NoUndefinedVersion; + bool NoinhibitExec; bool Nostdlib; bool OFormatBinary; bool Omagic; @@ -139,9 +143,8 @@ struct Configuration { bool SingleRoRx; bool Shared; bool Static = false; - bool SysvHash; + bool SysvHash = false; bool Target1Rel; - bool Threads; bool Trace; bool Verbose; bool WarnCommon; @@ -159,6 +162,7 @@ struct Configuration { bool ExitEarly; bool ZWxneeded; DiscardPolicy Discard; + OrphanHandlingPolicy OrphanHandling; SortSectionPolicy SortSection; StripPolicy Strip; UnresolvedPolicy UnresolvedSymbols; @@ -167,8 +171,7 @@ struct Configuration { ELFKind EKind = ELFNoneKind; uint16_t DefaultSymbolVersion = llvm::ELF::VER_NDX_GLOBAL; uint16_t EMachine = llvm::ELF::EM_NONE; - uint64_t ErrorLimit = 20; - uint64_t ImageBase; + llvm::Optional<uint64_t> ImageBase; uint64_t MaxPageSize; uint64_t ZStackSize; unsigned LTOPartitions; @@ -206,6 +209,9 @@ struct Configuration { // if that's true.) bool IsMips64EL; + // Holds set of ELF header flags for the target. + uint32_t EFlags = 0; + // The ELF spec defines two types of relocation table entries, RELA and // REL. RELA is a triplet of (offset, info, addend) while REL is a // tuple of (offset, info). Addends for REL are implicit and read from |