diff options
Diffstat (limited to 'contrib/llvm-project/lld/ELF/Config.h')
| -rw-r--r-- | contrib/llvm-project/lld/ELF/Config.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/contrib/llvm-project/lld/ELF/Config.h b/contrib/llvm-project/lld/ELF/Config.h index ff9d3dc0933c..ef1edbcd1992 100644 --- a/contrib/llvm-project/lld/ELF/Config.h +++ b/contrib/llvm-project/lld/ELF/Config.h @@ -61,6 +61,12 @@ enum class Target2Policy { Abs, Rel, GotRel }; // For tracking ARM Float Argument PCS enum class ARMVFPArgKind { Default, Base, VFP, ToolChain }; +// For -z noseparate-code, -z separate-code and -z separate-loadable-segments. +enum class SeparateSegmentKind { None, Code, Loadable }; + +// For -z *stack +enum class GnuStackKind { None, Exec, NoExec }; + struct SymbolVersion { llvm::StringRef name; bool isExternCpp; @@ -71,8 +77,8 @@ struct SymbolVersion { // can be found in version script if it is used for link. struct VersionDefinition { llvm::StringRef name; - uint16_t id = 0; - std::vector<SymbolVersion> globals; + uint16_t id; + std::vector<SymbolVersion> patterns; }; // This struct contains the global configuration for the linker. @@ -117,8 +123,6 @@ struct Configuration { 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<std::pair<const InputSectionBase *, const InputSectionBase *>, uint64_t> @@ -147,9 +151,9 @@ struct Configuration { bool executeOnly; bool exportDynamic; bool fixCortexA53Errata843419; + bool fixCortexA8; bool forceBTI; bool formatBinary = false; - bool requireCET; bool gcSections; bool gdbIndex; bool gnuHash = false; @@ -163,7 +167,9 @@ struct Configuration { bool ltoNewPassManager; bool mergeArmExidx; bool mipsN32Abi = false; + bool mmapOutputFile; bool nmagic; + bool noDynamicLinker = false; bool noinhibitExec; bool nostdlib; bool oFormatBinary; @@ -196,7 +202,7 @@ struct Configuration { bool writeAddends; bool zCombreloc; bool zCopyreloc; - bool zExecstack; + bool zForceIbt; bool zGlobal; bool zHazardplt; bool zIfuncNoplt; @@ -210,10 +216,12 @@ struct Configuration { bool zOrigin; bool zRelro; bool zRodynamic; + bool zShstk; bool zText; bool zRetpolineplt; bool zWxneeded; DiscardPolicy discard; + GnuStackKind zGnustack; ICFLevel icf; OrphanHandlingPolicy orphanHandling; SortSectionPolicy sortSection; @@ -222,8 +230,8 @@ struct Configuration { Target2Policy target2; ARMVFPArgKind armVFPArgs = ARMVFPArgKind::Default; BuildIdKind buildId = BuildIdKind::None; + SeparateSegmentKind zSeparate; ELFKind ekind = ELFNoneKind; - uint16_t defaultSymbolVersion = llvm::ELF::VER_NDX_GLOBAL; uint16_t emachine = llvm::ELF::EM_NONE; llvm::Optional<uint64_t> imageBase; uint64_t commonPageSize; @@ -237,7 +245,7 @@ struct Configuration { int32_t splitStackAdjustSize; // The following config options do not directly correspond to any - // particualr command line options. + // particular command line options. // True if we need to pass through relocations in input files to the // output file. Usually false because we consume relocations. @@ -309,6 +317,12 @@ struct Configuration { // The only instance of Configuration struct. extern Configuration *config; +// The first two elements of versionDefinitions represent VER_NDX_LOCAL and +// VER_NDX_GLOBAL. This helper returns other elements. +static inline ArrayRef<VersionDefinition> namedVersionDefs() { + return llvm::makeArrayRef(config->versionDefinitions).slice(2); +} + static inline void errorOrWarn(const Twine &msg) { if (!config->noinhibitExec) error(msg); |
