diff options
Diffstat (limited to 'contrib/llvm-project/lld/ELF/InputFiles.h')
-rw-r--r-- | contrib/llvm-project/lld/ELF/InputFiles.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/contrib/llvm-project/lld/ELF/InputFiles.h b/contrib/llvm-project/lld/ELF/InputFiles.h index 7af85e417ca5..cdd6b5c2ce99 100644 --- a/contrib/llvm-project/lld/ELF/InputFiles.h +++ b/contrib/llvm-project/lld/ELF/InputFiles.h @@ -92,9 +92,11 @@ public: return symbols; } - // Filename of .a which contained this file. If this file was - // not in an archive file, it is the empty string. We use this - // string for creating error messages. + // Get filename to use for linker script processing. + StringRef getNameForScript() const; + + // If not empty, this stores the name of the archive containing this file. + // We use this string for creating error messages. std::string archiveName; // If this is an architecture-specific file, the following members @@ -128,6 +130,10 @@ public: // [.got, .got + 0xFFFC]. bool ppc64SmallCodeModelTocRelocs = false; + // True if the file has TLSGD/TLSLD GOT relocations without R_PPC64_TLSGD or + // R_PPC64_TLSLD. Disable TLS relaxation to avoid bad code generation. + bool ppc64DisableTLSRelax = false; + // groupId is used for --warn-backrefs which is an optional error // checking feature. All files within the same --{start,end}-group or // --{start,end}-lib get the same group ID. Otherwise, each file gets a new @@ -147,6 +153,9 @@ protected: private: const Kind fileKind; + + // Cache for getNameForScript(). + mutable std::string nameForScriptCache; }; class ELFFileBase : public InputFile { @@ -180,12 +189,7 @@ protected: // .o file. template <class ELFT> class ObjFile : public ELFFileBase { - using Elf_Rel = typename ELFT::Rel; - using Elf_Rela = typename ELFT::Rela; - using Elf_Sym = typename ELFT::Sym; - using Elf_Shdr = typename ELFT::Shdr; - using Elf_Word = typename ELFT::Word; - using Elf_CGProfile = typename ELFT::CGProfile; + LLVM_ELF_IMPORT_TYPES_ELFT(ELFT) public: static bool classof(const InputFile *f) { return f->kind() == ObjKind; } @@ -307,6 +311,10 @@ public: template <class ELFT> void parse(); void fetch(); + // Check if a non-common symbol should be fetched to override a common + // definition. + bool shouldFetchForCommon(const StringRef &name); + bool fetched = false; private: @@ -326,6 +334,10 @@ public: // more than once.) void fetch(const Archive::Symbol &sym); + // Check if a non-common symbol should be fetched to override a common + // definition. + bool shouldFetchForCommon(const Archive::Symbol &sym); + size_t getMemberCount() const; size_t getFetchedMemberCount() const { return seen.size(); } |