diff options
Diffstat (limited to 'lld/ELF/InputFiles.h')
| -rw-r--r-- | lld/ELF/InputFiles.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/lld/ELF/InputFiles.h b/lld/ELF/InputFiles.h index 6febea3f437d..2bac30f54081 100644 --- a/lld/ELF/InputFiles.h +++ b/lld/ELF/InputFiles.h @@ -55,11 +55,8 @@ void parseFile(InputFile *file); // The root class of input files. class InputFile { -private: - // Cache for getNameForScript(). - mutable SmallString<0> nameForScriptCache; - protected: + SmallVector<Symbol *, 0> symbols; SmallVector<InputSectionBase *, 0> sections; public: @@ -103,15 +100,6 @@ public: // definition. bool shouldExtractForCommon(StringRef name); - // If not empty, this stores the name of the archive containing this file. - // We use this string for creating error messages. - SmallString<0> archiveName; - - // Cache for toString(). Only toString() should use this member. - mutable SmallString<0> toStringCache; - - SmallVector<Symbol *, 0> symbols; - // .got2 in the current file. This is used by PPC32 -fPIC/-fPIE to compute // offsets in PLT call stubs. InputSection *ppc32Got2 = nullptr; @@ -162,6 +150,17 @@ public: protected: InputFile(Kind k, MemoryBufferRef m); + +public: + // If not empty, this stores the name of the archive containing this file. + // We use this string for creating error messages. + SmallString<0> archiveName; + // Cache for toString(). Only toString() should use this member. + mutable SmallString<0> toStringCache; + +private: + // Cache for getNameForScript(). + mutable SmallString<0> nameForScriptCache; }; class ELFFileBase : public InputFile { @@ -212,6 +211,7 @@ protected: uint32_t firstGlobal = 0; public: + uint32_t andFeatures = 0; bool hasCommonSyms = false; }; @@ -268,8 +268,6 @@ public: // R_MIPS_GPREL16 / R_MIPS_GPREL32 relocations. uint32_t mipsGp0 = 0; - uint32_t andFeatures = 0; - // True if the file defines functions compiled with // -fsplit-stack. Usually false. bool splitStack = false; @@ -282,14 +280,15 @@ public: DWARFCache *getDwarf(); private: - void initializeSections(bool ignoreComdats); - void initializeSymbols(); + void initializeSections(bool ignoreComdats, + const llvm::object::ELFFile<ELFT> &obj); + void initializeSymbols(const llvm::object::ELFFile<ELFT> &obj); void initializeJustSymbols(); InputSectionBase *getRelocTarget(uint32_t idx, const Elf_Shdr &sec, uint32_t info); InputSectionBase *createInputSection(uint32_t idx, const Elf_Shdr &sec, - StringRef shstrtab); + StringRef name); bool shouldMerge(const Elf_Shdr &sec, StringRef name); |
