Rafael Espindola | 9d06ab6 | 2015-09-22 00:01:39 +0000 | [diff] [blame] | 1 | //===- InputSection.h -------------------------------------------*- C++ -*-===// |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 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 | |
Rafael Espindola | 9d06ab6 | 2015-09-22 00:01:39 +0000 | [diff] [blame] | 10 | #ifndef LLD_ELF_INPUT_SECTION_H |
| 11 | #define LLD_ELF_INPUT_SECTION_H |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 12 | |
Rui Ueyama | c4aaed9 | 2015-10-22 18:49:53 +0000 | [diff] [blame] | 13 | #include "Config.h" |
Rui Ueyama | 0fcdc73 | 2016-05-24 20:24:43 +0000 | [diff] [blame] | 14 | #include "Relocations.h" |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 15 | #include "lld/Core/LLVM.h" |
Rui Ueyama | b91bf1a | 2016-05-23 16:55:43 +0000 | [diff] [blame] | 16 | #include "llvm/ADT/DenseSet.h" |
Rui Ueyama | c00718f | 2016-02-23 03:34:37 +0000 | [diff] [blame] | 17 | #include "llvm/ADT/TinyPtrVector.h" |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 18 | #include "llvm/Object/ELF.h" |
| 19 | |
| 20 | namespace lld { |
Rafael Espindola | e0df00b | 2016-02-28 00:25:54 +0000 | [diff] [blame] | 21 | namespace elf { |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 22 | |
Rafael Espindola | 38c67a2 | 2016-04-15 14:41:56 +0000 | [diff] [blame] | 23 | class SymbolBody; |
| 24 | |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 25 | template <class ELFT> class ICF; |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 26 | template <class ELFT> class DefinedRegular; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 27 | template <class ELFT> class ObjectFile; |
Rafael Espindola | 832b93f | 2015-08-24 20:06:32 +0000 | [diff] [blame] | 28 | template <class ELFT> class OutputSection; |
Rui Ueyama | c7cc6ec | 2015-10-15 22:27:29 +0000 | [diff] [blame] | 29 | template <class ELFT> class OutputSectionBase; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 30 | |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 31 | // This corresponds to a section of an input file. |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 32 | template <class ELFT> class InputSectionBase { |
| 33 | protected: |
Rafael Espindola | 197d6a8 | 2016-04-22 16:39:59 +0000 | [diff] [blame] | 34 | typedef typename ELFT::Rel Elf_Rel; |
| 35 | typedef typename ELFT::Rela Elf_Rela; |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 36 | typedef typename ELFT::Shdr Elf_Shdr; |
| 37 | typedef typename ELFT::Sym Elf_Sym; |
| 38 | typedef typename ELFT::uint uintX_t; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 39 | const Elf_Shdr *Header; |
| 40 | |
| 41 | // The file this section is from. |
| 42 | ObjectFile<ELFT> *File; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 43 | |
| 44 | public: |
Simon Atanasyan | add74f3 | 2016-05-04 10:07:38 +0000 | [diff] [blame] | 45 | enum Kind { Regular, EHFrame, Merge, MipsReginfo, MipsOptions }; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 46 | Kind SectionKind; |
| 47 | |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 48 | InputSectionBase() : Repl(this) {} |
| 49 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 50 | InputSectionBase(ObjectFile<ELFT> *File, const Elf_Shdr *Header, |
| 51 | Kind SectionKind); |
| 52 | OutputSectionBase<ELFT> *OutSec = nullptr; |
Rui Ueyama | 424b408 | 2016-06-17 01:18:46 +0000 | [diff] [blame] | 53 | uint32_t Alignment; |
Rafael Espindola | 83b0dc6 | 2015-08-13 22:21:37 +0000 | [diff] [blame] | 54 | |
Rui Ueyama | c4aaed9 | 2015-10-22 18:49:53 +0000 | [diff] [blame] | 55 | // Used for garbage collection. |
Rui Ueyama | 6a9ef85 | 2016-02-25 18:49:09 +0000 | [diff] [blame] | 56 | bool Live; |
Rui Ueyama | c4aaed9 | 2015-10-22 18:49:53 +0000 | [diff] [blame] | 57 | |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 58 | // This pointer points to the "real" instance of this instance. |
| 59 | // Usually Repl == this. However, if ICF merges two sections, |
| 60 | // Repl pointer of one section points to another section. So, |
| 61 | // if you need to get a pointer to this instance, do not use |
| 62 | // this but instead this->Repl. |
| 63 | InputSectionBase<ELFT> *Repl; |
| 64 | |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 65 | // Returns the size of this section (even if this is a common or BSS.) |
Simon Atanasyan | 13f6da1 | 2016-03-31 21:26:23 +0000 | [diff] [blame] | 66 | size_t getSize() const; |
Rafael Espindola | 83b0dc6 | 2015-08-13 22:21:37 +0000 | [diff] [blame] | 67 | |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 68 | static InputSectionBase<ELFT> Discarded; |
Rafael Espindola | 83b0dc6 | 2015-08-13 22:21:37 +0000 | [diff] [blame] | 69 | |
Rafael Espindola | 5d83ccd | 2015-08-13 19:18:30 +0000 | [diff] [blame] | 70 | StringRef getSectionName() const; |
Michael J. Spencer | 8039dae2 | 2015-07-29 00:30:10 +0000 | [diff] [blame] | 71 | const Elf_Shdr *getSectionHdr() const { return Header; } |
Rafael Espindola | e1901cc | 2015-09-24 15:11:50 +0000 | [diff] [blame] | 72 | ObjectFile<ELFT> *getFile() const { return File; } |
Rui Ueyama | 809d8e2 | 2016-06-23 04:33:42 +0000 | [diff] [blame^] | 73 | uintX_t getOffset(const DefinedRegular<ELFT> &Sym) const; |
Rafael Espindola | db9bf4d | 2015-11-11 16:50:37 +0000 | [diff] [blame] | 74 | |
| 75 | // Translate an offset in the input section to an offset in the output |
| 76 | // section. |
Rui Ueyama | 809d8e2 | 2016-06-23 04:33:42 +0000 | [diff] [blame^] | 77 | uintX_t getOffset(uintX_t Offset) const; |
Rafael Espindola | db9bf4d | 2015-11-11 16:50:37 +0000 | [diff] [blame] | 78 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 79 | ArrayRef<uint8_t> getSectionData() const; |
Rui Ueyama | 1250464 | 2015-10-27 21:51:13 +0000 | [diff] [blame] | 80 | |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 81 | void relocate(uint8_t *Buf, uint8_t *BufEnd); |
Rui Ueyama | 809d8e2 | 2016-06-23 04:33:42 +0000 | [diff] [blame^] | 82 | std::vector<Relocation<ELFT>> Relocations; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 83 | }; |
| 84 | |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 85 | template <class ELFT> InputSectionBase<ELFT> InputSectionBase<ELFT>::Discarded; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 86 | |
Rui Ueyama | 3ea8727 | 2016-05-22 00:13:04 +0000 | [diff] [blame] | 87 | // SectionPiece represents a piece of splittable section contents. |
| 88 | struct SectionPiece { |
Rui Ueyama | 34dc99e | 2016-05-22 01:15:32 +0000 | [diff] [blame] | 89 | SectionPiece(size_t Off, ArrayRef<uint8_t> Data) |
Davide Italiano | e6c8fa4 | 2016-05-28 23:27:38 +0000 | [diff] [blame] | 90 | : InputOff(Off), Data((const uint8_t *)Data.data()), Size(Data.size()), |
Rui Ueyama | d884927 | 2016-05-25 16:37:01 +0000 | [diff] [blame] | 91 | Live(!Config->GcSections) {} |
| 92 | |
| 93 | ArrayRef<uint8_t> data() { return {Data, Size}; } |
| 94 | size_t size() const { return Size; } |
Rui Ueyama | 34dc99e | 2016-05-22 01:15:32 +0000 | [diff] [blame] | 95 | |
Rui Ueyama | 3ea8727 | 2016-05-22 00:13:04 +0000 | [diff] [blame] | 96 | size_t InputOff; |
| 97 | size_t OutputOff = -1; |
Rui Ueyama | d884927 | 2016-05-25 16:37:01 +0000 | [diff] [blame] | 98 | |
| 99 | private: |
| 100 | // We use bitfields because SplitInputSection is accessed by |
| 101 | // std::upper_bound very often. |
| 102 | // We want to save bits to make it cache friendly. |
Davide Italiano | e6c8fa4 | 2016-05-28 23:27:38 +0000 | [diff] [blame] | 103 | const uint8_t *Data; |
Rui Ueyama | d884927 | 2016-05-25 16:37:01 +0000 | [diff] [blame] | 104 | uint32_t Size : 31; |
| 105 | |
| 106 | public: |
| 107 | uint32_t Live : 1; |
Rui Ueyama | 3ea8727 | 2016-05-22 00:13:04 +0000 | [diff] [blame] | 108 | }; |
| 109 | |
Rui Ueyama | 5a32c76 | 2016-01-06 03:16:23 +0000 | [diff] [blame] | 110 | // Usually sections are copied to the output as atomic chunks of data, |
| 111 | // but some special types of sections are split into small pieces of data |
| 112 | // and each piece is copied to a different place in the output. |
| 113 | // This class represents such special sections. |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 114 | template <class ELFT> class SplitInputSection : public InputSectionBase<ELFT> { |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 115 | typedef typename ELFT::Shdr Elf_Shdr; |
| 116 | typedef typename ELFT::uint uintX_t; |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 117 | |
| 118 | public: |
| 119 | SplitInputSection(ObjectFile<ELFT> *File, const Elf_Shdr *Header, |
| 120 | typename InputSectionBase<ELFT>::Kind SectionKind); |
Rui Ueyama | 5a32c76 | 2016-01-06 03:16:23 +0000 | [diff] [blame] | 121 | |
Rui Ueyama | 3ea8727 | 2016-05-22 00:13:04 +0000 | [diff] [blame] | 122 | // Splittable sections are handled as a sequence of data |
| 123 | // rather than a single large blob of data. |
| 124 | std::vector<SectionPiece> Pieces; |
Rui Ueyama | 5a32c76 | 2016-01-06 03:16:23 +0000 | [diff] [blame] | 125 | |
Rui Ueyama | 34dc99e | 2016-05-22 01:15:32 +0000 | [diff] [blame] | 126 | // Returns the SectionPiece at a given input section offset. |
Rui Ueyama | 90fa372 | 2016-05-22 00:41:38 +0000 | [diff] [blame] | 127 | SectionPiece *getSectionPiece(uintX_t Offset); |
Rui Ueyama | 809d8e2 | 2016-06-23 04:33:42 +0000 | [diff] [blame^] | 128 | const SectionPiece *getSectionPiece(uintX_t Offset) const; |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 129 | }; |
| 130 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 131 | // This corresponds to a SHF_MERGE section of an input file. |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 132 | template <class ELFT> class MergeInputSection : public SplitInputSection<ELFT> { |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 133 | typedef typename ELFT::uint uintX_t; |
| 134 | typedef typename ELFT::Sym Elf_Sym; |
| 135 | typedef typename ELFT::Shdr Elf_Shdr; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 136 | |
| 137 | public: |
| 138 | MergeInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header); |
| 139 | static bool classof(const InputSectionBase<ELFT> *S); |
Rui Ueyama | b91bf1a | 2016-05-23 16:55:43 +0000 | [diff] [blame] | 140 | void splitIntoPieces(); |
| 141 | |
| 142 | // Mark the piece at a given offset live. Used by GC. |
| 143 | void markLiveAt(uintX_t Offset) { LiveOffsets.insert(Offset); } |
| 144 | |
| 145 | // Translate an offset in the input section to an offset |
| 146 | // in the output section. |
Rui Ueyama | 809d8e2 | 2016-06-23 04:33:42 +0000 | [diff] [blame^] | 147 | uintX_t getOffset(uintX_t Offset) const; |
Rui Ueyama | b91bf1a | 2016-05-23 16:55:43 +0000 | [diff] [blame] | 148 | |
Rui Ueyama | 406b469 | 2016-05-27 14:39:13 +0000 | [diff] [blame] | 149 | void finalizePieces(); |
| 150 | |
Rui Ueyama | b91bf1a | 2016-05-23 16:55:43 +0000 | [diff] [blame] | 151 | private: |
Rui Ueyama | 406b469 | 2016-05-27 14:39:13 +0000 | [diff] [blame] | 152 | llvm::DenseMap<uintX_t, uintX_t> OffsetMap; |
Rui Ueyama | b91bf1a | 2016-05-23 16:55:43 +0000 | [diff] [blame] | 153 | llvm::DenseSet<uintX_t> LiveOffsets; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 154 | }; |
| 155 | |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 156 | // This corresponds to a .eh_frame section of an input file. |
Rui Ueyama | 0b9a903 | 2016-05-24 04:19:20 +0000 | [diff] [blame] | 157 | template <class ELFT> class EhInputSection : public SplitInputSection<ELFT> { |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 158 | public: |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 159 | typedef typename ELFT::Shdr Elf_Shdr; |
| 160 | typedef typename ELFT::uint uintX_t; |
Rui Ueyama | 0b9a903 | 2016-05-24 04:19:20 +0000 | [diff] [blame] | 161 | EhInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header); |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 162 | static bool classof(const InputSectionBase<ELFT> *S); |
Rui Ueyama | 88abd9b | 2016-05-22 23:53:00 +0000 | [diff] [blame] | 163 | void split(); |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 164 | |
| 165 | // Translate an offset in the input section to an offset in the output |
| 166 | // section. |
Rui Ueyama | 809d8e2 | 2016-06-23 04:33:42 +0000 | [diff] [blame^] | 167 | uintX_t getOffset(uintX_t Offset) const; |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 168 | |
| 169 | // Relocation section that refer to this one. |
| 170 | const Elf_Shdr *RelocSection = nullptr; |
| 171 | }; |
| 172 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 173 | // This corresponds to a non SHF_MERGE section of an input file. |
| 174 | template <class ELFT> class InputSection : public InputSectionBase<ELFT> { |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 175 | friend ICF<ELFT>; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 176 | typedef InputSectionBase<ELFT> Base; |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 177 | typedef typename ELFT::Shdr Elf_Shdr; |
| 178 | typedef typename ELFT::Rela Elf_Rela; |
| 179 | typedef typename ELFT::Rel Elf_Rel; |
| 180 | typedef typename ELFT::Sym Elf_Sym; |
| 181 | typedef typename ELFT::uint uintX_t; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 182 | |
| 183 | public: |
| 184 | InputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header); |
| 185 | |
| 186 | // Write this section to a mmap'ed file, assuming Buf is pointing to |
| 187 | // beginning of the output section. |
| 188 | void writeTo(uint8_t *Buf); |
| 189 | |
Michael J. Spencer | 67bc8d6 | 2015-08-27 23:15:56 +0000 | [diff] [blame] | 190 | // Relocation sections that refer to this one. |
Rui Ueyama | c00718f | 2016-02-23 03:34:37 +0000 | [diff] [blame] | 191 | llvm::TinyPtrVector<const Elf_Shdr *> RelocSections; |
Michael J. Spencer | 67bc8d6 | 2015-08-27 23:15:56 +0000 | [diff] [blame] | 192 | |
Rui Ueyama | edffd91 | 2015-10-14 21:00:23 +0000 | [diff] [blame] | 193 | // The offset from beginning of the output sections this section was assigned |
| 194 | // to. The writer sets a value. |
Rui Ueyama | 55c3f89 | 2015-10-15 01:58:40 +0000 | [diff] [blame] | 195 | uint64_t OutSecOff = 0; |
Rui Ueyama | edffd91 | 2015-10-14 21:00:23 +0000 | [diff] [blame] | 196 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 197 | static bool classof(const InputSectionBase<ELFT> *S); |
George Rimar | 58941ee | 2016-02-25 08:23:37 +0000 | [diff] [blame] | 198 | |
| 199 | InputSectionBase<ELFT> *getRelocatedSection(); |
| 200 | |
Simon Atanasyan | 13f6da1 | 2016-03-31 21:26:23 +0000 | [diff] [blame] | 201 | // Register thunk related to the symbol. When the section is written |
| 202 | // to a mmap'ed file, target is requested to write an actual thunk code. |
| 203 | // Now thunks is supported for MIPS target only. |
| 204 | void addThunk(SymbolBody &Body); |
| 205 | |
| 206 | // The offset of synthetic thunk code from beginning of this section. |
| 207 | uint64_t getThunkOff() const; |
| 208 | |
| 209 | // Size of chunk with thunks code. |
| 210 | uint64_t getThunksSize() const; |
| 211 | |
Rui Ueyama | 2b6fb80 | 2016-04-28 18:42:04 +0000 | [diff] [blame] | 212 | template <class RelTy> |
| 213 | void relocateNonAlloc(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels); |
| 214 | |
George Rimar | 58941ee | 2016-02-25 08:23:37 +0000 | [diff] [blame] | 215 | private: |
Rui Ueyama | fc467e7 | 2016-03-13 05:06:50 +0000 | [diff] [blame] | 216 | template <class RelTy> |
Rafael Espindola | 0f7ccc3 | 2016-04-05 14:47:28 +0000 | [diff] [blame] | 217 | void copyRelocations(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 218 | |
| 219 | // Called by ICF to merge two input sections. |
| 220 | void replace(InputSection<ELFT> *Other); |
| 221 | |
| 222 | // Used by ICF. |
| 223 | uint64_t GroupId = 0; |
Simon Atanasyan | 13f6da1 | 2016-03-31 21:26:23 +0000 | [diff] [blame] | 224 | |
| 225 | llvm::TinyPtrVector<const SymbolBody *> Thunks; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 226 | }; |
| 227 | |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 228 | // MIPS .reginfo section provides information on the registers used by the code |
| 229 | // in the object file. Linker should collect this information and write a single |
| 230 | // .reginfo section in the output file. The output section contains a union of |
| 231 | // used registers masks taken from input .reginfo sections and final value |
| 232 | // of the `_gp` symbol. For details: Chapter 4 / "Register Information" at |
| 233 | // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf |
| 234 | template <class ELFT> |
| 235 | class MipsReginfoInputSection : public InputSectionBase<ELFT> { |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 236 | typedef typename ELFT::Shdr Elf_Shdr; |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 237 | |
| 238 | public: |
Rui Ueyama | 70eed36 | 2016-01-06 22:42:43 +0000 | [diff] [blame] | 239 | MipsReginfoInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Hdr); |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 240 | static bool classof(const InputSectionBase<ELFT> *S); |
Rui Ueyama | 70eed36 | 2016-01-06 22:42:43 +0000 | [diff] [blame] | 241 | |
Simon Atanasyan | add74f3 | 2016-05-04 10:07:38 +0000 | [diff] [blame] | 242 | const llvm::object::Elf_Mips_RegInfo<ELFT> *Reginfo = nullptr; |
| 243 | }; |
| 244 | |
| 245 | template <class ELFT> |
| 246 | class MipsOptionsInputSection : public InputSectionBase<ELFT> { |
| 247 | typedef typename ELFT::Shdr Elf_Shdr; |
| 248 | |
| 249 | public: |
| 250 | MipsOptionsInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Hdr); |
| 251 | static bool classof(const InputSectionBase<ELFT> *S); |
| 252 | |
| 253 | const llvm::object::Elf_Mips_RegInfo<ELFT> *Reginfo = nullptr; |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 254 | }; |
| 255 | |
Rafael Espindola | e0df00b | 2016-02-28 00:25:54 +0000 | [diff] [blame] | 256 | } // namespace elf |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 257 | } // namespace lld |
| 258 | |
| 259 | #endif |