blob: df4aaf0e79fd32018e7d58a1d5ec36ff9a0a2656 [file] [log] [blame]
Rafael Espindola5805c4f2015-09-21 21:38:08 +00001//===- OutputSections.h -----------------------------------------*- C++ -*-===//
2//
3// The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLD_ELF_OUTPUT_SECTIONS_H
11#define LLD_ELF_OUTPUT_SECTIONS_H
12
13#include "lld/Core/LLVM.h"
14
Rafael Espindolac159c962015-10-19 21:00:02 +000015#include "llvm/ADT/MapVector.h"
Rafael Espindola5805c4f2015-09-21 21:38:08 +000016#include "llvm/MC/StringTableBuilder.h"
17#include "llvm/Object/ELF.h"
18
Davide Italiano85121bb2015-09-25 03:56:11 +000019#include "Config.h"
20
Rafael Espindola5805c4f2015-09-21 21:38:08 +000021#include <type_traits>
22
23namespace lld {
24namespace elf2 {
25
26class SymbolBody;
Rui Ueyama3ce825e2015-10-09 21:07:25 +000027template <class ELFT> class SymbolTable;
Rafael Espindola5805c4f2015-09-21 21:38:08 +000028template <class ELFT> class SymbolTableSection;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +000029template <class ELFT> class StringTableSection;
Rafael Espindola5805c4f2015-09-21 21:38:08 +000030template <class ELFT> class InputSection;
Rafael Espindolac159c962015-10-19 21:00:02 +000031template <class ELFT> class MergeInputSection;
Rafael Espindola5805c4f2015-09-21 21:38:08 +000032template <class ELFT> class OutputSection;
33template <class ELFT> class ObjectFile;
34template <class ELFT> class DefinedRegular;
Rafael Espindolacd076f02015-09-25 18:19:03 +000035template <class ELFT> class ELFSymbolBody;
Rafael Espindola5805c4f2015-09-21 21:38:08 +000036
Rafael Espindola5805c4f2015-09-21 21:38:08 +000037template <class ELFT>
Rafael Espindola932efcf2015-10-19 20:24:44 +000038static inline typename llvm::object::ELFFile<ELFT>::uintX_t
39getAddend(const typename llvm::object::ELFFile<ELFT>::Elf_Rel &Rel) {
40 return 0;
41}
Rafael Espindola5805c4f2015-09-21 21:38:08 +000042
43template <class ELFT>
Rafael Espindola932efcf2015-10-19 20:24:44 +000044static inline typename llvm::object::ELFFile<ELFT>::uintX_t
45getAddend(const typename llvm::object::ELFFile<ELFT>::Elf_Rela &Rel) {
46 return Rel.r_addend;
47}
48
49template <class ELFT>
50typename llvm::object::ELFFile<ELFT>::uintX_t getSymVA(const SymbolBody &S);
51
52template <class ELFT, bool IsRela>
Rafael Espindola5805c4f2015-09-21 21:38:08 +000053typename llvm::object::ELFFile<ELFT>::uintX_t
Rui Ueyama126d08f2015-10-12 20:28:22 +000054getLocalRelTarget(const ObjectFile<ELFT> &File,
Rafael Espindola932efcf2015-10-19 20:24:44 +000055 const llvm::object::Elf_Rel_Impl<ELFT, IsRela> &Rel);
Rafael Espindolacc6ebb82015-10-14 18:42:16 +000056bool canBePreempted(const SymbolBody *Body, bool NeedsGot);
Rafael Espindola4f674ed2015-10-05 15:24:04 +000057template <class ELFT> bool includeInSymtab(const SymbolBody &B);
58
Rafael Espindola05a3dd22015-09-22 23:38:23 +000059bool includeInDynamicSymtab(const SymbolBody &B);
Igor Kudrin1b0d7062015-10-22 08:21:35 +000060bool includeInGnuHashTable(const SymbolBody &B);
Rafael Espindolad1cf4212015-10-05 16:25:43 +000061
62template <class ELFT>
63bool shouldKeepInSymtab(
Rafael Espindola444576d2015-10-09 19:25:07 +000064 const ObjectFile<ELFT> &File, StringRef Name,
65 const typename llvm::object::ELFFile<ELFT>::Elf_Sym &Sym);
Davide Italiano85121bb2015-09-25 03:56:11 +000066
Rafael Espindola71675852015-09-22 00:16:19 +000067// This represents a section in an output file.
68// Different sub classes represent different types of sections. Some contain
69// input sections, others are created by the linker.
70// The writer creates multiple OutputSections and assign them unique,
Rafael Espindola5805c4f2015-09-21 21:38:08 +000071// non-overlapping file offsets and VAs.
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +000072template <class ELFT> class OutputSectionBase {
Rafael Espindola5805c4f2015-09-21 21:38:08 +000073public:
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +000074 typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
75 typedef typename llvm::object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
Rafael Espindola5805c4f2015-09-21 21:38:08 +000076
77 OutputSectionBase(StringRef Name, uint32_t sh_type, uintX_t sh_flags);
78 void setVA(uintX_t VA) { Header.sh_addr = VA; }
79 uintX_t getVA() const { return Header.sh_addr; }
80 void setFileOffset(uintX_t Off) { Header.sh_offset = Off; }
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +000081 void writeHeaderTo(Elf_Shdr *SHdr);
Rafael Espindola5805c4f2015-09-21 21:38:08 +000082 StringRef getName() { return Name; }
83 void setNameOffset(uintX_t Offset) { Header.sh_name = Offset; }
84
Rui Ueyama2317d0d2015-10-15 20:55:22 +000085 unsigned SectionIndex;
Rafael Espindola5805c4f2015-09-21 21:38:08 +000086
87 // Returns the size of the section in the output file.
Rafael Espindola77572242015-10-02 19:37:55 +000088 uintX_t getSize() const { return Header.sh_size; }
Rafael Espindola5805c4f2015-09-21 21:38:08 +000089 void setSize(uintX_t Val) { Header.sh_size = Val; }
90 uintX_t getFlags() { return Header.sh_flags; }
91 uintX_t getFileOff() { return Header.sh_offset; }
92 uintX_t getAlign() {
93 // The ELF spec states that a value of 0 means the section has no alignment
94 // constraits.
95 return std::max<uintX_t>(Header.sh_addralign, 1);
96 }
97 uint32_t getType() { return Header.sh_type; }
98
Rafael Espindola5805c4f2015-09-21 21:38:08 +000099 virtual void finalize() {}
100 virtual void writeTo(uint8_t *Buf) = 0;
101
102protected:
103 StringRef Name;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000104 Elf_Shdr Header;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000105 ~OutputSectionBase() = default;
106};
107
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000108template <class ELFT> class GotSection final : public OutputSectionBase<ELFT> {
109 typedef OutputSectionBase<ELFT> Base;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000110 typedef typename Base::uintX_t uintX_t;
111
112public:
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000113 GotSection();
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000114 void finalize() override {
Rui Ueyama5f551ae2015-10-14 14:02:06 +0000115 this->Header.sh_size = Entries.size() * sizeof(uintX_t);
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000116 }
Rafael Espindolaa6627382015-10-06 23:56:53 +0000117 void writeTo(uint8_t *Buf) override;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000118 void addEntry(SymbolBody *Sym);
119 bool empty() const { return Entries.empty(); }
120 uintX_t getEntryAddr(const SymbolBody &B) const;
121
122private:
123 std::vector<const SymbolBody *> Entries;
124};
125
George Rimar648a2c32015-10-20 08:54:27 +0000126template <class ELFT>
127class GotPltSection final : public OutputSectionBase<ELFT> {
128 typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
129
130public:
131 GotPltSection();
132 void finalize() override;
133 void writeTo(uint8_t *Buf) override;
134 void addEntry(SymbolBody *Sym);
135 bool empty() const;
136 uintX_t getEntryAddr(const SymbolBody &B) const;
137
138private:
139 std::vector<const SymbolBody *> Entries;
140};
141
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000142template <class ELFT> class PltSection final : public OutputSectionBase<ELFT> {
143 typedef OutputSectionBase<ELFT> Base;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000144 typedef typename Base::uintX_t uintX_t;
145
146public:
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000147 PltSection();
Hal Finkel6c2a3b82015-10-08 21:51:31 +0000148 void finalize() override;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000149 void writeTo(uint8_t *Buf) override;
150 void addEntry(SymbolBody *Sym);
151 bool empty() const { return Entries.empty(); }
152 uintX_t getEntryAddr(const SymbolBody &B) const;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000153
154private:
155 std::vector<const SymbolBody *> Entries;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000156};
157
158template <class ELFT> struct DynamicReloc {
159 typedef typename llvm::object::ELFFile<ELFT>::Elf_Rel Elf_Rel;
160 const InputSection<ELFT> &C;
161 const Elf_Rel &RI;
162};
163
164template <class ELFT>
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000165class SymbolTableSection final : public OutputSectionBase<ELFT> {
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000166public:
167 typedef typename llvm::object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
168 typedef typename llvm::object::ELFFile<ELFT>::Elf_Sym Elf_Sym;
169 typedef typename llvm::object::ELFFile<ELFT>::Elf_Sym_Range Elf_Sym_Range;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000170 typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000171 SymbolTableSection(SymbolTable<ELFT> &Table,
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000172 StringTableSection<ELFT> &StrTabSec);
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000173
Rui Ueyama0db335f2015-10-07 16:58:54 +0000174 void finalize() override;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000175 void writeTo(uint8_t *Buf) override;
Igor Kudrinab665fc2015-10-20 21:47:58 +0000176 void addLocalSymbol(StringRef Name);
177 void addSymbol(SymbolBody *Body);
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000178 StringTableSection<ELFT> &getStrTabSec() const { return StrTabSec; }
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000179 unsigned getNumSymbols() const { return NumVisible + 1; }
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000180 unsigned getNumGnuHashSymbols() const { return NumGnuHashed; }
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000181
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000182 struct SymbolData {
183 SymbolData(SymbolBody *Body, bool HasGnuHash);
184 SymbolBody *Body;
185 bool HasGnuHash;
186 uint32_t GnuHash;
187 };
188 ArrayRef<SymbolData> getSymbols() const { return Symbols; }
189 ArrayRef<SymbolData> getGnuHashSymbols() const;
Igor Kudrinab665fc2015-10-20 21:47:58 +0000190
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000191private:
Rui Ueyama8ddfa812015-09-30 00:32:10 +0000192 void writeLocalSymbols(uint8_t *&Buf);
Igor Kudrinea6a8352015-10-19 08:01:51 +0000193 void writeGlobalSymbols(uint8_t *Buf);
Rui Ueyama8ddfa812015-09-30 00:32:10 +0000194
Igor Kudrin853b88d2015-10-20 20:52:14 +0000195 static uint8_t getSymbolBinding(SymbolBody *Body);
196
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000197 SymbolTable<ELFT> &Table;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000198 StringTableSection<ELFT> &StrTabSec;
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000199 std::vector<SymbolData> Symbols;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000200 unsigned NumVisible = 0;
201 unsigned NumLocals = 0;
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000202 unsigned NumGnuHashed = 0;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000203};
204
205template <class ELFT>
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000206class RelocationSection final : public OutputSectionBase<ELFT> {
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000207 typedef typename llvm::object::ELFFile<ELFT>::Elf_Rel Elf_Rel;
208 typedef typename llvm::object::ELFFile<ELFT>::Elf_Rela Elf_Rela;
Rafael Espindola3c83e2b2015-10-05 21:09:37 +0000209 typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000210
211public:
George Rimar648a2c32015-10-20 08:54:27 +0000212 RelocationSection(StringRef Name, bool IsRela);
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000213 void addReloc(const DynamicReloc<ELFT> &Reloc) { Relocs.push_back(Reloc); }
214 void finalize() override;
215 void writeTo(uint8_t *Buf) override;
216 bool hasRelocs() const { return !Relocs.empty(); }
217 bool isRela() const { return IsRela; }
218
219private:
220 std::vector<DynamicReloc<ELFT>> Relocs;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000221 const bool IsRela;
222};
223
224template <class ELFT>
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000225class OutputSection final : public OutputSectionBase<ELFT> {
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000226public:
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000227 typedef typename llvm::object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
228 typedef typename llvm::object::ELFFile<ELFT>::Elf_Sym Elf_Sym;
229 typedef typename llvm::object::ELFFile<ELFT>::Elf_Rel Elf_Rel;
230 typedef typename llvm::object::ELFFile<ELFT>::Elf_Rela Elf_Rela;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000231 typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000232 OutputSection(StringRef Name, uint32_t sh_type, uintX_t sh_flags);
Rafael Espindola71675852015-09-22 00:16:19 +0000233 void addSection(InputSection<ELFT> *C);
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000234 void writeTo(uint8_t *Buf) override;
235
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000236private:
Rafael Espindola71675852015-09-22 00:16:19 +0000237 std::vector<InputSection<ELFT> *> Sections;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000238};
239
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000240template <class ELFT>
Rafael Espindolac159c962015-10-19 21:00:02 +0000241class MergeOutputSection final : public OutputSectionBase<ELFT> {
242 typedef typename OutputSectionBase<ELFT>::uintX_t uintX_t;
243
244public:
245 MergeOutputSection(StringRef Name, uint32_t sh_type, uintX_t sh_flags);
246 void addSection(MergeInputSection<ELFT> *S);
247 void writeTo(uint8_t *Buf) override;
248
249 unsigned getOffset(ArrayRef<uint8_t> Val);
250
251private:
252 // This map is used to find if we already have an entry for a given value and,
253 // if so, at what offset it is.
254 llvm::MapVector<ArrayRef<uint8_t>, uintX_t> Offsets;
255};
256
257template <class ELFT>
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000258class InterpSection final : public OutputSectionBase<ELFT> {
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000259public:
260 InterpSection();
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000261 void writeTo(uint8_t *Buf);
262};
263
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000264template <class ELFT>
265class StringTableSection final : public OutputSectionBase<ELFT> {
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000266public:
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000267 typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
George Rimar0f5ac9f2015-10-20 17:21:35 +0000268 StringTableSection(StringRef Name, bool Dynamic);
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000269 void add(StringRef S) { StrTabBuilder.add(S); }
270 size_t getFileOff(StringRef S) const { return StrTabBuilder.getOffset(S); }
271 StringRef data() const { return StrTabBuilder.data(); }
272 void writeTo(uint8_t *Buf) override;
273
274 void finalize() override {
Rafael Espindola6779a232015-10-23 21:48:35 +0000275 StrTabBuilder.finalize();
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000276 this->Header.sh_size = StrTabBuilder.data().size();
277 }
278
279 bool isDynamic() const { return Dynamic; }
280
281private:
282 const bool Dynamic;
Rafael Espindola6779a232015-10-23 21:48:35 +0000283 llvm::StringTableBuilder StrTabBuilder{llvm::StringTableBuilder::ELF};
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000284};
285
286template <class ELFT>
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000287class HashTableSection final : public OutputSectionBase<ELFT> {
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000288 typedef typename llvm::object::ELFFile<ELFT>::Elf_Word Elf_Word;
289
290public:
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000291 HashTableSection();
Rui Ueyama0db335f2015-10-07 16:58:54 +0000292 void finalize() override;
293 void writeTo(uint8_t *Buf) override;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000294};
295
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000296// Outputs GNU Hash section. For detailed explanation see:
297// https://blogs.oracle.com/ali/entry/gnu_hash_elf_sections
298template <class ELFT>
299class GnuHashTableSection final : public OutputSectionBase<ELFT> {
300 typedef typename llvm::object::ELFFile<ELFT>::Elf_Off Elf_Off;
301 typedef typename llvm::object::ELFFile<ELFT>::Elf_Word Elf_Word;
302 typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
303
304public:
305 GnuHashTableSection();
306 void finalize() override;
307 void writeTo(uint8_t *Buf) override;
308
309 static unsigned calcNBuckets(unsigned NumHashed);
310
311private:
312 static unsigned calcMaskWords(unsigned NumHashed);
313
314 void writeHeader(uint8_t *&Buf);
315 void writeBloomFilter(uint8_t *&Buf);
316 void writeHashTable(uint8_t *Buf);
317
318 unsigned MaskWords;
319 unsigned NBuckets;
320 unsigned Shift2;
321};
322
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000323template <class ELFT>
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000324class DynamicSection final : public OutputSectionBase<ELFT> {
325 typedef OutputSectionBase<ELFT> Base;
326 typedef typename llvm::object::ELFFile<ELFT>::Elf_Dyn Elf_Dyn;
Rui Ueyama2dfd74f2015-09-30 21:57:53 +0000327 typedef typename llvm::object::ELFFile<ELFT>::Elf_Rel Elf_Rel;
328 typedef typename llvm::object::ELFFile<ELFT>::Elf_Rela Elf_Rela;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000329 typedef typename llvm::object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
Rui Ueyama2dfd74f2015-09-30 21:57:53 +0000330 typedef typename llvm::object::ELFFile<ELFT>::Elf_Sym Elf_Sym;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000331
332public:
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000333 DynamicSection(SymbolTable<ELFT> &SymTab);
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000334 void finalize() override;
335 void writeTo(uint8_t *Buf) override;
336
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000337 OutputSectionBase<ELFT> *PreInitArraySec = nullptr;
338 OutputSectionBase<ELFT> *InitArraySec = nullptr;
339 OutputSectionBase<ELFT> *FiniArraySec = nullptr;
Rafael Espindola77572242015-10-02 19:37:55 +0000340
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000341private:
Rui Ueyama3ce825e2015-10-09 21:07:25 +0000342 SymbolTable<ELFT> &SymTab;
Igor Kudrinb1f2b512015-10-05 10:29:46 +0000343 const ELFSymbolBody<ELFT> *InitSym = nullptr;
344 const ELFSymbolBody<ELFT> *FiniSym = nullptr;
Rui Ueyamac96d0dd2015-10-21 17:47:10 +0000345 uint32_t DtFlags = 0;
346 uint32_t DtFlags1 = 0;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000347};
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000348
349// All output sections that are hadnled by the linker specially are
350// globally accessible. Writer initializes them, so don't use them
351// until Writer is initialized.
352template <class ELFT> struct Out {
353 static DynamicSection<ELFT> *Dynamic;
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000354 static GnuHashTableSection<ELFT> *GnuHashTab;
George Rimar648a2c32015-10-20 08:54:27 +0000355 static GotPltSection<ELFT> *GotPlt;
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000356 static GotSection<ELFT> *Got;
357 static HashTableSection<ELFT> *HashTab;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000358 static InterpSection<ELFT> *Interp;
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000359 static OutputSection<ELFT> *Bss;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000360 static OutputSectionBase<ELFT> *Opd;
Hal Finkeldaedc122015-10-12 23:16:53 +0000361 static uint8_t *OpdBuf;
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000362 static PltSection<ELFT> *Plt;
363 static RelocationSection<ELFT> *RelaDyn;
George Rimar648a2c32015-10-20 08:54:27 +0000364 static RelocationSection<ELFT> *RelaPlt;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000365 static StringTableSection<ELFT> *DynStrTab;
George Rimar0f5ac9f2015-10-20 17:21:35 +0000366 static StringTableSection<ELFT> *ShStrTab;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000367 static StringTableSection<ELFT> *StrTab;
Rui Ueyama15ef5e12015-10-07 19:18:16 +0000368 static SymbolTableSection<ELFT> *DynSymTab;
369 static SymbolTableSection<ELFT> *SymTab;
370};
Rui Ueyamad888d102015-10-09 19:34:55 +0000371
372template <class ELFT> DynamicSection<ELFT> *Out<ELFT>::Dynamic;
Igor Kudrin1b0d7062015-10-22 08:21:35 +0000373template <class ELFT> GnuHashTableSection<ELFT> *Out<ELFT>::GnuHashTab;
George Rimar648a2c32015-10-20 08:54:27 +0000374template <class ELFT> GotPltSection<ELFT> *Out<ELFT>::GotPlt;
Rui Ueyamad888d102015-10-09 19:34:55 +0000375template <class ELFT> GotSection<ELFT> *Out<ELFT>::Got;
376template <class ELFT> HashTableSection<ELFT> *Out<ELFT>::HashTab;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000377template <class ELFT> InterpSection<ELFT> *Out<ELFT>::Interp;
Rui Ueyamad888d102015-10-09 19:34:55 +0000378template <class ELFT> OutputSection<ELFT> *Out<ELFT>::Bss;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000379template <class ELFT> OutputSectionBase<ELFT> *Out<ELFT>::Opd;
Hal Finkeldaedc122015-10-12 23:16:53 +0000380template <class ELFT> uint8_t *Out<ELFT>::OpdBuf;
Rui Ueyamad888d102015-10-09 19:34:55 +0000381template <class ELFT> PltSection<ELFT> *Out<ELFT>::Plt;
382template <class ELFT> RelocationSection<ELFT> *Out<ELFT>::RelaDyn;
George Rimar648a2c32015-10-20 08:54:27 +0000383template <class ELFT> RelocationSection<ELFT> *Out<ELFT>::RelaPlt;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000384template <class ELFT> StringTableSection<ELFT> *Out<ELFT>::DynStrTab;
George Rimar0f5ac9f2015-10-20 17:21:35 +0000385template <class ELFT> StringTableSection<ELFT> *Out<ELFT>::ShStrTab;
Rui Ueyamac7cc6ec2015-10-15 22:27:29 +0000386template <class ELFT> StringTableSection<ELFT> *Out<ELFT>::StrTab;
Rui Ueyamad888d102015-10-09 19:34:55 +0000387template <class ELFT> SymbolTableSection<ELFT> *Out<ELFT>::DynSymTab;
388template <class ELFT> SymbolTableSection<ELFT> *Out<ELFT>::SymTab;
Rafael Espindola5805c4f2015-09-21 21:38:08 +0000389}
390}
391#endif