diff options
Diffstat (limited to 'ELF/OutputSections.h')
| -rw-r--r-- | ELF/OutputSections.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ELF/OutputSections.h b/ELF/OutputSections.h index b2845773e9afd..efb6aabe9743c 100644 --- a/ELF/OutputSections.h +++ b/ELF/OutputSections.h @@ -14,7 +14,6 @@ #include "InputSection.h" #include "LinkerScript.h" #include "Relocations.h" - #include "lld/Common/LLVM.h" #include "llvm/MC/StringTableBuilder.h" #include "llvm/Object/ELF.h" @@ -49,10 +48,10 @@ public: static bool classof(const BaseCommand *C); - uint64_t getLMA() const { return Addr + LMAOffset; } + uint64_t getLMA() const { return PtLoad ? Addr + PtLoad->LMAOffset : Addr; } template <typename ELFT> void writeHeaderTo(typename ELFT::Shdr *SHdr); - unsigned SectionIndex; + uint32_t SectionIndex = UINT32_MAX; unsigned SortRank; uint32_t getPhdrFlags() const; @@ -78,7 +77,6 @@ public: // The following fields correspond to Elf_Shdr members. uint64_t Offset = 0; - uint64_t LMAOffset = 0; uint64_t Addr = 0; uint32_t ShName = 0; @@ -89,6 +87,7 @@ public: // The following members are normally only used in linker scripts. MemoryRegion *MemRegion = nullptr; + MemoryRegion *LMARegion = nullptr; Expr AddrExpr; Expr AlignExpr; Expr LMAExpr; @@ -99,13 +98,17 @@ public: ConstraintKind Constraint = ConstraintKind::NoConstraint; std::string Location; std::string MemoryRegionName; + std::string LMARegionName; + bool NonAlloc = false; bool Noload = false; + bool ExpressionsUseSymbols = false; + bool InOverlay = false; template <class ELFT> void finalize(); template <class ELFT> void writeTo(uint8_t *Buf); template <class ELFT> void maybeCompress(); - void sort(std::function<int(InputSectionBase *S)> Order); + void sort(llvm::function_ref<int(InputSectionBase *S)> Order); void sortInitFini(); void sortCtorsDtors(); @@ -119,13 +122,13 @@ private: int getPriority(StringRef S); +std::vector<InputSection *> getInputSections(OutputSection* OS); + // All output sections that are handled by the linker specially are // globally accessible. Writer initializes them, so don't use them // until Writer is initialized. struct Out { static uint8_t First; - static OutputSection *Opd; - static uint8_t *OpdBuf; static PhdrEntry *TlsPhdr; static OutputSection *DebugInfo; static OutputSection *ElfHeader; @@ -142,8 +145,6 @@ namespace lld { namespace elf { uint64_t getHeaderSize(); -void sortByOrder(llvm::MutableArrayRef<InputSection *> In, - std::function<int(InputSectionBase *S)> Order); extern std::vector<OutputSection *> OutputSections; } // namespace elf |
