1 //===- SyntheticSection.h ---------------------------------------*- C++ -*-===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Synthetic sections represent chunks of linker-created data. If you
11 // need to create a chunk of data that to be included in some section
12 // in the result, you probably want to create that as a synthetic section.
14 // Synthetic sections are designed as input sections as opposed to
15 // output sections because we want to allow them to be manipulated
16 // using linker scripts just like other input sections from regular
19 //===----------------------------------------------------------------------===//
21 #ifndef LLD_ELF_SYNTHETIC_SECTION_H
22 #define LLD_ELF_SYNTHETIC_SECTION_H
26 #include "InputSection.h"
27 #include "llvm/ADT/MapVector.h"
28 #include "llvm/MC/StringTableBuilder.h"
35 class SyntheticSection : public InputSection {
37 SyntheticSection(uint64_t Flags, uint32_t Type, uint32_t Alignment,
39 : InputSection(Flags, Type, Alignment, {}, Name,
40 InputSectionBase::Synthetic) {
44 virtual ~SyntheticSection() = default;
45 virtual void writeTo(uint8_t *Buf) = 0;
46 virtual size_t getSize() const = 0;
47 virtual void finalizeContents() {}
48 // If the section has the SHF_ALLOC flag and the size may be changed if
49 // thunks are added, update the section size.
50 virtual void updateAllocSize() {}
51 // If any additional finalization of contents are needed post thunk creation.
52 virtual void postThunkContents() {}
53 virtual bool empty() const { return false; }
54 uint64_t getVA() const;
56 static bool classof(const InputSectionBase *D) {
57 return D->kind() == InputSectionBase::Synthetic;
62 EhSectionPiece *Piece = nullptr;
63 std::vector<EhSectionPiece *> FdePieces;
66 // Section for .eh_frame.
67 template <class ELFT> class EhFrameSection final : public SyntheticSection {
68 typedef typename ELFT::Shdr Elf_Shdr;
69 typedef typename ELFT::Rel Elf_Rel;
70 typedef typename ELFT::Rela Elf_Rela;
72 void updateAlignment(uint64_t Val) {
73 if (Val > this->Alignment)
74 this->Alignment = Val;
79 void writeTo(uint8_t *Buf) override;
80 void finalizeContents() override;
81 bool empty() const override { return Sections.empty(); }
82 size_t getSize() const override { return Size; }
84 void addSection(InputSectionBase *S);
88 std::vector<EhInputSection *> Sections;
92 template <class RelTy>
93 void addSectionAux(EhInputSection *S, llvm::ArrayRef<RelTy> Rels);
95 template <class RelTy>
96 CieRecord *addCie(EhSectionPiece &Piece, ArrayRef<RelTy> Rels);
98 template <class RelTy>
99 bool isFdeLive(EhSectionPiece &Piece, ArrayRef<RelTy> Rels);
101 uint64_t getFdePc(uint8_t *Buf, size_t Off, uint8_t Enc);
103 std::vector<CieRecord *> Cies;
105 // CIE records are uniquified by their contents and personality functions.
106 llvm::DenseMap<std::pair<ArrayRef<uint8_t>, SymbolBody *>, CieRecord> CieMap;
109 class GotSection : public SyntheticSection {
112 size_t getSize() const override { return Size; }
113 void finalizeContents() override;
114 bool empty() const override;
115 void writeTo(uint8_t *Buf) override;
117 void addEntry(SymbolBody &Sym);
118 bool addDynTlsEntry(SymbolBody &Sym);
120 uint64_t getGlobalDynAddr(const SymbolBody &B) const;
121 uint64_t getGlobalDynOffset(const SymbolBody &B) const;
123 uint64_t getTlsIndexVA() { return this->getVA() + TlsIndexOff; }
124 uint32_t getTlsIndexOff() const { return TlsIndexOff; }
126 // Flag to force GOT to be in output if we have relocations
127 // that relies on its address.
128 bool HasGotOffRel = false;
131 size_t NumEntries = 0;
132 uint32_t TlsIndexOff = -1;
136 // .note.gnu.build-id section.
137 class BuildIdSection : public SyntheticSection {
138 // First 16 bytes are a header.
139 static const unsigned HeaderSize = 16;
143 void writeTo(uint8_t *Buf) override;
144 size_t getSize() const override { return HeaderSize + HashSize; }
145 void writeBuildId(llvm::ArrayRef<uint8_t> Buf);
148 void computeHash(llvm::ArrayRef<uint8_t> Buf,
149 std::function<void(uint8_t *, ArrayRef<uint8_t>)> Hash);
155 // BssSection is used to reserve space for copy relocations and common symbols.
156 // We create three instances of this class for .bss, .bss.rel.ro and "COMMON",
157 // that are used for writable symbols, read-only symbols and common symbols,
159 class BssSection final : public SyntheticSection {
161 BssSection(StringRef Name);
162 void writeTo(uint8_t *) override {}
163 bool empty() const override { return getSize() == 0; }
164 size_t reserveSpace(uint64_t Size, uint32_t Alignment);
165 size_t getSize() const override { return Size; }
171 class MipsGotSection final : public SyntheticSection {
174 void writeTo(uint8_t *Buf) override;
175 size_t getSize() const override { return Size; }
176 void updateAllocSize() override;
177 void finalizeContents() override;
178 bool empty() const override;
179 void addEntry(SymbolBody &Sym, int64_t Addend, RelExpr Expr);
180 bool addDynTlsEntry(SymbolBody &Sym);
182 uint64_t getPageEntryOffset(const SymbolBody &B, int64_t Addend) const;
183 uint64_t getBodyEntryOffset(const SymbolBody &B, int64_t Addend) const;
184 uint64_t getGlobalDynOffset(const SymbolBody &B) const;
186 // Returns the symbol which corresponds to the first entry of the global part
187 // of GOT on MIPS platform. It is required to fill up MIPS-specific dynamic
189 // Returns nullptr if the global part is empty.
190 const SymbolBody *getFirstGlobalEntry() const;
192 // Returns the number of entries in the local part of GOT including
193 // the number of reserved entries.
194 unsigned getLocalEntriesNum() const;
196 // Returns offset of TLS part of the MIPS GOT table. This part goes
197 // after 'local' and 'global' entries.
198 uint64_t getTlsOffset() const;
200 uint32_t getTlsIndexOff() const { return TlsIndexOff; }
202 uint64_t getGp() const;
205 // MIPS GOT consists of three parts: local, global and tls. Each part
206 // contains different types of entries. Here is a layout of GOT:
207 // - Header entries |
208 // - Page entries | Local part
209 // - Local entries (16-bit access) |
210 // - Local entries (32-bit access) |
211 // - Normal global entries || Global part
212 // - Reloc-only global entries ||
213 // - TLS entries ||| TLS part
216 // Two entries hold predefined value 0x0 and 0x80000000.
218 // These entries created by R_MIPS_GOT_PAGE relocation and R_MIPS_GOT16
219 // relocation against local symbols. They are initialized by higher 16-bit
220 // of the corresponding symbol's value. So each 64kb of address space
221 // requires a single GOT entry.
222 // Local entries (16-bit access):
223 // These entries created by GOT relocations against global non-preemptible
224 // symbols so dynamic linker is not necessary to resolve the symbol's
225 // values. "16-bit access" means that corresponding relocations address
226 // GOT using 16-bit index. Each unique Symbol-Addend pair has its own
228 // Local entries (32-bit access):
229 // These entries are the same as above but created by relocations which
230 // address GOT using 32-bit index (R_MIPS_GOT_HI16/LO16 etc).
231 // Normal global entries:
232 // These entries created by GOT relocations against preemptible global
233 // symbols. They need to be initialized by dynamic linker and they ordered
234 // exactly as the corresponding entries in the dynamic symbols table.
235 // Reloc-only global entries:
236 // These entries created for symbols that are referenced by dynamic
237 // relocations R_MIPS_REL32. These entries are not accessed with gp-relative
238 // addressing, but MIPS ABI requires that these entries be present in GOT.
240 // Entries created by TLS relocations.
242 // Number of "Header" entries.
243 static const unsigned HeaderEntriesNum = 2;
244 // Number of allocated "Page" entries.
245 uint32_t PageEntriesNum = 0;
246 // Map output sections referenced by MIPS GOT relocations
247 // to the first index of "Page" entries allocated for this section.
248 llvm::SmallMapVector<const OutputSection *, size_t, 16> PageIndexMap;
250 typedef std::pair<const SymbolBody *, uint64_t> GotEntry;
251 typedef std::vector<GotEntry> GotEntries;
252 // Map from Symbol-Addend pair to the GOT index.
253 llvm::DenseMap<GotEntry, size_t> EntryIndexMap;
254 // Local entries (16-bit access).
255 GotEntries LocalEntries;
256 // Local entries (32-bit access).
257 GotEntries LocalEntries32;
259 // Normal and reloc-only global entries.
260 GotEntries GlobalEntries;
263 std::vector<const SymbolBody *> TlsEntries;
265 uint32_t TlsIndexOff = -1;
269 class GotPltSection final : public SyntheticSection {
272 void addEntry(SymbolBody &Sym);
273 size_t getSize() const override;
274 void writeTo(uint8_t *Buf) override;
275 bool empty() const override { return Entries.empty(); }
278 std::vector<const SymbolBody *> Entries;
281 // The IgotPltSection is a Got associated with the PltSection for GNU Ifunc
282 // Symbols that will be relocated by Target->IRelativeRel.
283 // On most Targets the IgotPltSection will immediately follow the GotPltSection
284 // on ARM the IgotPltSection will immediately follow the GotSection.
285 class IgotPltSection final : public SyntheticSection {
288 void addEntry(SymbolBody &Sym);
289 size_t getSize() const override;
290 void writeTo(uint8_t *Buf) override;
291 bool empty() const override { return Entries.empty(); }
294 std::vector<const SymbolBody *> Entries;
297 class StringTableSection final : public SyntheticSection {
299 StringTableSection(StringRef Name, bool Dynamic);
300 unsigned addString(StringRef S, bool HashIt = true);
301 void writeTo(uint8_t *Buf) override;
302 size_t getSize() const override { return Size; }
303 bool isDynamic() const { return Dynamic; }
310 llvm::DenseMap<StringRef, unsigned> StringMap;
311 std::vector<StringRef> Strings;
316 DynamicReloc(uint32_t Type, const InputSectionBase *InputSec,
317 uint64_t OffsetInSec, bool UseSymVA, SymbolBody *Sym,
319 : Type(Type), Sym(Sym), InputSec(InputSec), OffsetInSec(OffsetInSec),
320 UseSymVA(UseSymVA), Addend(Addend) {}
322 uint64_t getOffset() const;
323 int64_t getAddend() const;
324 uint32_t getSymIndex() const;
325 const InputSectionBase *getInputSec() const { return InputSec; }
331 const InputSectionBase *InputSec = nullptr;
332 uint64_t OffsetInSec;
337 template <class ELFT> class DynamicSection final : public SyntheticSection {
338 typedef typename ELFT::Dyn Elf_Dyn;
339 typedef typename ELFT::Rel Elf_Rel;
340 typedef typename ELFT::Rela Elf_Rela;
341 typedef typename ELFT::Shdr Elf_Shdr;
342 typedef typename ELFT::Sym Elf_Sym;
344 // The .dynamic section contains information for the dynamic linker.
345 // The section consists of fixed size entries, which consist of
346 // type and value fields. Value are one of plain integers, symbol
347 // addresses, or section addresses. This struct represents the entry.
351 OutputSection *OutSec;
354 const SymbolBody *Sym;
356 enum KindT { SecAddr, SecSize, SymAddr, PlainInt, InSecAddr } Kind;
357 Entry(int32_t Tag, OutputSection *OutSec, KindT Kind = SecAddr)
358 : Tag(Tag), OutSec(OutSec), Kind(Kind) {}
359 Entry(int32_t Tag, InputSection *Sec)
360 : Tag(Tag), InSec(Sec), Kind(InSecAddr) {}
361 Entry(int32_t Tag, uint64_t Val) : Tag(Tag), Val(Val), Kind(PlainInt) {}
362 Entry(int32_t Tag, const SymbolBody *Sym)
363 : Tag(Tag), Sym(Sym), Kind(SymAddr) {}
366 // finalizeContents() fills this vector with the section contents.
367 std::vector<Entry> Entries;
371 void finalizeContents() override;
372 void writeTo(uint8_t *Buf) override;
373 size_t getSize() const override { return Size; }
377 void add(Entry E) { Entries.push_back(E); }
381 template <class ELFT> class RelocationSection final : public SyntheticSection {
382 typedef typename ELFT::Rel Elf_Rel;
383 typedef typename ELFT::Rela Elf_Rela;
386 RelocationSection(StringRef Name, bool Sort);
387 void addReloc(const DynamicReloc &Reloc);
388 unsigned getRelocOffset();
389 void finalizeContents() override;
390 void writeTo(uint8_t *Buf) override;
391 bool empty() const override { return Relocs.empty(); }
392 size_t getSize() const override { return Relocs.size() * this->Entsize; }
393 size_t getRelativeRelocCount() const { return NumRelativeRelocs; }
397 size_t NumRelativeRelocs = 0;
398 std::vector<DynamicReloc> Relocs;
401 struct SymbolTableEntry {
406 class SymbolTableBaseSection : public SyntheticSection {
408 SymbolTableBaseSection(StringTableSection &StrTabSec);
409 void finalizeContents() override;
410 void postThunkContents() override;
411 size_t getSize() const override { return getNumSymbols() * Entsize; }
412 void addSymbol(SymbolBody *Body);
413 unsigned getNumSymbols() const { return Symbols.size() + 1; }
414 size_t getSymbolIndex(SymbolBody *Body);
415 ArrayRef<SymbolTableEntry> getSymbols() const { return Symbols; }
418 // A vector of symbols and their string table offsets.
419 std::vector<SymbolTableEntry> Symbols;
421 StringTableSection &StrTabSec;
424 template <class ELFT>
425 class SymbolTableSection final : public SymbolTableBaseSection {
426 typedef typename ELFT::Sym Elf_Sym;
429 SymbolTableSection(StringTableSection &StrTabSec);
430 void writeTo(uint8_t *Buf) override;
433 // Outputs GNU Hash section. For detailed explanation see:
434 // https://blogs.oracle.com/ali/entry/gnu_hash_elf_sections
435 class GnuHashTableSection final : public SyntheticSection {
437 GnuHashTableSection();
438 void finalizeContents() override;
439 void writeTo(uint8_t *Buf) override;
440 size_t getSize() const override { return Size; }
442 // Adds symbols to the hash table.
443 // Sorts the input to satisfy GNU hash section requirements.
444 void addSymbols(std::vector<SymbolTableEntry> &Symbols);
447 size_t getShift2() const { return Config->Is64 ? 6 : 5; }
449 void writeBloomFilter(uint8_t *Buf);
450 void writeHashTable(uint8_t *Buf);
458 std::vector<Entry> Symbols;
464 template <class ELFT> class HashTableSection final : public SyntheticSection {
467 void finalizeContents() override;
468 void writeTo(uint8_t *Buf) override;
469 size_t getSize() const override { return Size; }
475 // The PltSection is used for both the Plt and Iplt. The former always has a
476 // header as its first entry that is used at run-time to resolve lazy binding.
477 // The latter is used for GNU Ifunc symbols, that will be subject to a
478 // Target->IRelativeRel.
479 class PltSection : public SyntheticSection {
481 PltSection(size_t HeaderSize);
482 void writeTo(uint8_t *Buf) override;
483 size_t getSize() const override;
484 bool empty() const override { return Entries.empty(); }
487 template <class ELFT> void addEntry(SymbolBody &Sym);
490 void writeHeader(uint8_t *Buf){};
491 void addHeaderSymbols(){};
492 unsigned getPltRelocOff() const;
493 std::vector<std::pair<const SymbolBody *, unsigned>> Entries;
494 // Iplt always has HeaderSize of 0, the Plt HeaderSize is always non-zero
498 class GdbIndexSection final : public SyntheticSection {
499 const unsigned OffsetTypeSize = 4;
500 const unsigned CuListOffset = 6 * OffsetTypeSize;
501 const unsigned CompilationUnitSize = 16;
502 const unsigned AddressEntrySize = 16 + OffsetTypeSize;
503 const unsigned SymTabEntrySize = 2 * OffsetTypeSize;
507 void finalizeContents() override;
508 void writeTo(uint8_t *Buf) override;
509 size_t getSize() const override;
510 bool empty() const override;
512 // Pairs of [CU Offset, CU length].
513 std::vector<std::pair<uint64_t, uint64_t>> CompilationUnits;
515 llvm::StringTableBuilder StringPool;
517 GdbHashTab SymbolTable;
519 // The CU vector portion of the constant pool.
520 std::vector<std::set<uint32_t>> CuVectors;
522 std::vector<AddressEntry> AddressArea;
525 void readDwarf(InputSection *Sec);
527 uint32_t CuTypesOffset;
528 uint32_t SymTabOffset;
529 uint32_t ConstantPoolOffset;
530 uint32_t StringPoolOffset;
532 size_t CuVectorsSize = 0;
533 std::vector<size_t> CuVectorsOffset;
535 bool Finalized = false;
538 // --eh-frame-hdr option tells linker to construct a header for all the
539 // .eh_frame sections. This header is placed to a section named .eh_frame_hdr
540 // and also to a PT_GNU_EH_FRAME segment.
541 // At runtime the unwinder then can find all the PT_GNU_EH_FRAME segments by
542 // calling dl_iterate_phdr.
543 // This section contains a lookup table for quick binary search of FDEs.
544 // Detailed info about internals can be found in Ian Lance Taylor's blog:
545 // http://www.airs.com/blog/archives/460 (".eh_frame")
546 // http://www.airs.com/blog/archives/462 (".eh_frame_hdr")
547 template <class ELFT> class EhFrameHeader final : public SyntheticSection {
550 void writeTo(uint8_t *Buf) override;
551 size_t getSize() const override;
552 void addFde(uint32_t Pc, uint32_t FdeVA);
553 bool empty() const override;
561 std::vector<FdeData> Fdes;
564 // For more information about .gnu.version and .gnu.version_r see:
565 // https://www.akkadia.org/drepper/symbol-versioning
567 // The .gnu.version_d section which has a section type of SHT_GNU_verdef shall
568 // contain symbol version definitions. The number of entries in this section
569 // shall be contained in the DT_VERDEFNUM entry of the .dynamic section.
570 // The section shall contain an array of Elf_Verdef structures, optionally
571 // followed by an array of Elf_Verdaux structures.
572 template <class ELFT>
573 class VersionDefinitionSection final : public SyntheticSection {
574 typedef typename ELFT::Verdef Elf_Verdef;
575 typedef typename ELFT::Verdaux Elf_Verdaux;
578 VersionDefinitionSection();
579 void finalizeContents() override;
580 size_t getSize() const override;
581 void writeTo(uint8_t *Buf) override;
584 void writeOne(uint8_t *Buf, uint32_t Index, StringRef Name, size_t NameOff);
586 unsigned FileDefNameOff;
589 // The .gnu.version section specifies the required version of each symbol in the
590 // dynamic symbol table. It contains one Elf_Versym for each dynamic symbol
591 // table entry. An Elf_Versym is just a 16-bit integer that refers to a version
592 // identifier defined in the either .gnu.version_r or .gnu.version_d section.
593 // The values 0 and 1 are reserved. All other values are used for versions in
594 // the own object or in any of the dependencies.
595 template <class ELFT>
596 class VersionTableSection final : public SyntheticSection {
597 typedef typename ELFT::Versym Elf_Versym;
600 VersionTableSection();
601 void finalizeContents() override;
602 size_t getSize() const override;
603 void writeTo(uint8_t *Buf) override;
604 bool empty() const override;
607 // The .gnu.version_r section defines the version identifiers used by
608 // .gnu.version. It contains a linked list of Elf_Verneed data structures. Each
609 // Elf_Verneed specifies the version requirements for a single DSO, and contains
610 // a reference to a linked list of Elf_Vernaux data structures which define the
611 // mapping from version identifiers to version names.
612 template <class ELFT> class VersionNeedSection final : public SyntheticSection {
613 typedef typename ELFT::Verneed Elf_Verneed;
614 typedef typename ELFT::Vernaux Elf_Vernaux;
616 // A vector of shared files that need Elf_Verneed data structures and the
617 // string table offsets of their sonames.
618 std::vector<std::pair<SharedFile<ELFT> *, size_t>> Needed;
620 // The next available version identifier.
624 VersionNeedSection();
625 void addSymbol(SharedSymbol *SS);
626 void finalizeContents() override;
627 void writeTo(uint8_t *Buf) override;
628 size_t getSize() const override;
629 size_t getNeedNum() const { return Needed.size(); }
630 bool empty() const override;
633 // MergeSyntheticSection is a class that allows us to put mergeable sections
634 // with different attributes in a single output sections. To do that
635 // we put them into MergeSyntheticSection synthetic input sections which are
636 // attached to regular output sections.
637 class MergeSyntheticSection final : public SyntheticSection {
639 MergeSyntheticSection(StringRef Name, uint32_t Type, uint64_t Flags,
641 void addSection(MergeInputSection *MS);
642 void writeTo(uint8_t *Buf) override;
643 void finalizeContents() override;
644 bool shouldTailMerge() const;
645 size_t getSize() const override;
648 void finalizeTailMerge();
649 void finalizeNoTailMerge();
651 bool Finalized = false;
652 llvm::StringTableBuilder Builder;
653 std::vector<MergeInputSection *> Sections;
656 // .MIPS.abiflags section.
657 template <class ELFT>
658 class MipsAbiFlagsSection final : public SyntheticSection {
659 typedef llvm::object::Elf_Mips_ABIFlags<ELFT> Elf_Mips_ABIFlags;
662 static MipsAbiFlagsSection *create();
664 MipsAbiFlagsSection(Elf_Mips_ABIFlags Flags);
665 size_t getSize() const override { return sizeof(Elf_Mips_ABIFlags); }
666 void writeTo(uint8_t *Buf) override;
669 Elf_Mips_ABIFlags Flags;
672 // .MIPS.options section.
673 template <class ELFT> class MipsOptionsSection final : public SyntheticSection {
674 typedef llvm::object::Elf_Mips_Options<ELFT> Elf_Mips_Options;
675 typedef llvm::object::Elf_Mips_RegInfo<ELFT> Elf_Mips_RegInfo;
678 static MipsOptionsSection *create();
680 MipsOptionsSection(Elf_Mips_RegInfo Reginfo);
681 void writeTo(uint8_t *Buf) override;
683 size_t getSize() const override {
684 return sizeof(Elf_Mips_Options) + sizeof(Elf_Mips_RegInfo);
688 Elf_Mips_RegInfo Reginfo;
691 // MIPS .reginfo section.
692 template <class ELFT> class MipsReginfoSection final : public SyntheticSection {
693 typedef llvm::object::Elf_Mips_RegInfo<ELFT> Elf_Mips_RegInfo;
696 static MipsReginfoSection *create();
698 MipsReginfoSection(Elf_Mips_RegInfo Reginfo);
699 size_t getSize() const override { return sizeof(Elf_Mips_RegInfo); }
700 void writeTo(uint8_t *Buf) override;
703 Elf_Mips_RegInfo Reginfo;
706 // This is a MIPS specific section to hold a space within the data segment
707 // of executable file which is pointed to by the DT_MIPS_RLD_MAP entry.
708 // See "Dynamic section" in Chapter 5 in the following document:
709 // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
710 class MipsRldMapSection : public SyntheticSection {
713 size_t getSize() const override { return Config->Wordsize; }
714 void writeTo(uint8_t *Buf) override {}
717 class ARMExidxSentinelSection : public SyntheticSection {
719 ARMExidxSentinelSection();
720 size_t getSize() const override { return 8; }
721 void writeTo(uint8_t *Buf) override;
724 // A container for one or more linker generated thunks. Instances of these
725 // thunks including ARM interworking and Mips LA25 PI to non-PI thunks.
726 class ThunkSection : public SyntheticSection {
728 // ThunkSection in OS, with desired OutSecOff of Off
729 ThunkSection(OutputSection *OS, uint64_t Off);
731 // Add a newly created Thunk to this container:
732 // Thunk is given offset from start of this InputSection
733 // Thunk defines a symbol in this InputSection that can be used as target
735 void addThunk(Thunk *T);
736 size_t getSize() const override { return Size; }
737 void writeTo(uint8_t *Buf) override;
738 InputSection *getTargetInputSection() const;
741 std::vector<const Thunk *> Thunks;
745 template <class ELFT> InputSection *createCommonSection();
746 InputSection *createInterpSection();
747 template <class ELFT> MergeInputSection *createCommentSection();
749 SymbolBody *addSyntheticLocal(StringRef Name, uint8_t Type, uint64_t Value,
750 uint64_t Size, InputSectionBase *Section);
752 // Linker generated sections which can be used as inputs.
754 static InputSection *ARMAttributes;
755 static BssSection *Bss;
756 static BssSection *BssRelRo;
757 static BuildIdSection *BuildId;
758 static InputSection *Common;
759 static SyntheticSection *Dynamic;
760 static StringTableSection *DynStrTab;
761 static SymbolTableBaseSection *DynSymTab;
762 static GnuHashTableSection *GnuHashTab;
763 static InputSection *Interp;
764 static GdbIndexSection *GdbIndex;
765 static GotSection *Got;
766 static GotPltSection *GotPlt;
767 static IgotPltSection *IgotPlt;
768 static MipsGotSection *MipsGot;
769 static MipsRldMapSection *MipsRldMap;
770 static PltSection *Plt;
771 static PltSection *Iplt;
772 static StringTableSection *ShStrTab;
773 static StringTableSection *StrTab;
774 static SymbolTableBaseSection *SymTab;
777 template <class ELFT> struct In : public InX {
778 static EhFrameHeader<ELFT> *EhFrameHdr;
779 static EhFrameSection<ELFT> *EhFrame;
780 static HashTableSection<ELFT> *HashTab;
781 static RelocationSection<ELFT> *RelaDyn;
782 static RelocationSection<ELFT> *RelaPlt;
783 static RelocationSection<ELFT> *RelaIplt;
784 static VersionDefinitionSection<ELFT> *VerDef;
785 static VersionTableSection<ELFT> *VerSym;
786 static VersionNeedSection<ELFT> *VerNeed;
789 template <class ELFT> EhFrameHeader<ELFT> *In<ELFT>::EhFrameHdr;
790 template <class ELFT> EhFrameSection<ELFT> *In<ELFT>::EhFrame;
791 template <class ELFT> HashTableSection<ELFT> *In<ELFT>::HashTab;
792 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaDyn;
793 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaPlt;
794 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaIplt;
795 template <class ELFT> VersionDefinitionSection<ELFT> *In<ELFT>::VerDef;
796 template <class ELFT> VersionTableSection<ELFT> *In<ELFT>::VerSym;
797 template <class ELFT> VersionNeedSection<ELFT> *In<ELFT>::VerNeed;