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" |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 14 | #include "lld/Core/LLVM.h" |
Rui Ueyama | c00718f | 2016-02-23 03:34:37 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/TinyPtrVector.h" |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 16 | #include "llvm/Object/ELF.h" |
| 17 | |
| 18 | namespace lld { |
Rafael Espindola | e0df00b | 2016-02-28 00:25:54 +0000 | [diff] [blame] | 19 | namespace elf { |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 20 | |
Rafael Espindola | 38c67a2 | 2016-04-15 14:41:56 +0000 | [diff] [blame] | 21 | class SymbolBody; |
| 22 | |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 23 | template <class ELFT> class ICF; |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 24 | template <class ELFT> class DefinedRegular; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 25 | template <class ELFT> class ObjectFile; |
Rafael Espindola | 832b93f | 2015-08-24 20:06:32 +0000 | [diff] [blame] | 26 | template <class ELFT> class OutputSection; |
Rui Ueyama | c7cc6ec | 2015-10-15 22:27:29 +0000 | [diff] [blame] | 27 | template <class ELFT> class OutputSectionBase; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 28 | |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 29 | enum RelExpr { |
| 30 | R_ABS, |
| 31 | R_GOT, |
Rafael Espindola | 3f5d634 | 2016-04-18 12:07:13 +0000 | [diff] [blame] | 32 | R_GOTONLY_PC, |
| 33 | R_GOTREL, |
| 34 | R_GOT_FROM_END, |
Rafael Espindola | de2c76e | 2016-05-04 14:38:55 +0000 | [diff] [blame] | 35 | R_GOT_OFF, |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 36 | R_GOT_PAGE_PC, |
| 37 | R_GOT_PC, |
Rafael Espindola | ebb04b9 | 2016-05-04 14:44:22 +0000 | [diff] [blame] | 38 | R_HINT, |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 39 | R_MIPS_GOT, |
| 40 | R_MIPS_GOT_LOCAL, |
Rafael Espindola | 3f5d634 | 2016-04-18 12:07:13 +0000 | [diff] [blame] | 41 | R_NEG_TLS, |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 42 | R_PAGE_PC, |
| 43 | R_PC, |
| 44 | R_PLT, |
| 45 | R_PLT_PC, |
| 46 | R_PPC_OPD, |
| 47 | R_PPC_PLT_OPD, |
| 48 | R_PPC_TOC, |
| 49 | R_RELAX_TLS_GD_TO_IE, |
| 50 | R_RELAX_TLS_GD_TO_IE_PC, |
| 51 | R_RELAX_TLS_GD_TO_LE, |
| 52 | R_RELAX_TLS_IE_TO_LE, |
| 53 | R_RELAX_TLS_LD_TO_LE, |
| 54 | R_SIZE, |
| 55 | R_THUNK, |
Rafael Espindola | 3f5d634 | 2016-04-18 12:07:13 +0000 | [diff] [blame] | 56 | R_TLS, |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 57 | R_TLSGD, |
| 58 | R_TLSGD_PC, |
| 59 | R_TLSLD, |
| 60 | R_TLSLD_PC |
| 61 | }; |
| 62 | |
Rafael Espindola | c6b17bd | 2016-04-20 17:30:22 +0000 | [diff] [blame] | 63 | inline bool refersToGotEntry(RelExpr Expr) { |
| 64 | return Expr == R_GOT || Expr == R_GOT_OFF || Expr == R_MIPS_GOT || |
| 65 | Expr == R_MIPS_GOT_LOCAL || Expr == R_GOT_PAGE_PC || |
Rafael Espindola | a85efd9 | 2016-04-30 01:15:17 +0000 | [diff] [blame] | 66 | Expr == R_GOT_PC || Expr == R_GOT_FROM_END || Expr == R_TLSGD || |
| 67 | Expr == R_TLSGD_PC; |
Rafael Espindola | c6b17bd | 2016-04-20 17:30:22 +0000 | [diff] [blame] | 68 | } |
| 69 | |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 70 | struct Relocation { |
| 71 | RelExpr Expr; |
| 72 | uint32_t Type; |
| 73 | uint64_t Offset; |
| 74 | uint64_t Addend; |
| 75 | SymbolBody *Sym; |
| 76 | }; |
| 77 | |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 78 | // This corresponds to a section of an input file. |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 79 | template <class ELFT> class InputSectionBase { |
| 80 | protected: |
Rafael Espindola | 197d6a8 | 2016-04-22 16:39:59 +0000 | [diff] [blame] | 81 | typedef typename ELFT::Rel Elf_Rel; |
| 82 | typedef typename ELFT::Rela Elf_Rela; |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 83 | typedef typename ELFT::Shdr Elf_Shdr; |
| 84 | typedef typename ELFT::Sym Elf_Sym; |
| 85 | typedef typename ELFT::uint uintX_t; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 86 | const Elf_Shdr *Header; |
| 87 | |
| 88 | // The file this section is from. |
| 89 | ObjectFile<ELFT> *File; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 90 | |
| 91 | public: |
Simon Atanasyan | add74f3 | 2016-05-04 10:07:38 +0000 | [diff] [blame] | 92 | enum Kind { Regular, EHFrame, Merge, MipsReginfo, MipsOptions }; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 93 | Kind SectionKind; |
| 94 | |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 95 | InputSectionBase() : Repl(this) {} |
| 96 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 97 | InputSectionBase(ObjectFile<ELFT> *File, const Elf_Shdr *Header, |
| 98 | Kind SectionKind); |
| 99 | OutputSectionBase<ELFT> *OutSec = nullptr; |
Rui Ueyama | 6a9ef85 | 2016-02-25 18:49:09 +0000 | [diff] [blame] | 100 | uint32_t Align; |
Rafael Espindola | 83b0dc6 | 2015-08-13 22:21:37 +0000 | [diff] [blame] | 101 | |
Rui Ueyama | c4aaed9 | 2015-10-22 18:49:53 +0000 | [diff] [blame] | 102 | // Used for garbage collection. |
Rui Ueyama | 6a9ef85 | 2016-02-25 18:49:09 +0000 | [diff] [blame] | 103 | bool Live; |
Rui Ueyama | c4aaed9 | 2015-10-22 18:49:53 +0000 | [diff] [blame] | 104 | |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 105 | // This pointer points to the "real" instance of this instance. |
| 106 | // Usually Repl == this. However, if ICF merges two sections, |
| 107 | // Repl pointer of one section points to another section. So, |
| 108 | // if you need to get a pointer to this instance, do not use |
| 109 | // this but instead this->Repl. |
| 110 | InputSectionBase<ELFT> *Repl; |
| 111 | |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 112 | // 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] | 113 | size_t getSize() const; |
Rafael Espindola | 83b0dc6 | 2015-08-13 22:21:37 +0000 | [diff] [blame] | 114 | |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 115 | static InputSectionBase<ELFT> Discarded; |
Rafael Espindola | 83b0dc6 | 2015-08-13 22:21:37 +0000 | [diff] [blame] | 116 | |
Rafael Espindola | 5d83ccd | 2015-08-13 19:18:30 +0000 | [diff] [blame] | 117 | StringRef getSectionName() const; |
Michael J. Spencer | 8039dae2 | 2015-07-29 00:30:10 +0000 | [diff] [blame] | 118 | const Elf_Shdr *getSectionHdr() const { return Header; } |
Rafael Espindola | e1901cc | 2015-09-24 15:11:50 +0000 | [diff] [blame] | 119 | ObjectFile<ELFT> *getFile() const { return File; } |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 120 | uintX_t getOffset(const DefinedRegular<ELFT> &Sym); |
Rafael Espindola | db9bf4d | 2015-11-11 16:50:37 +0000 | [diff] [blame] | 121 | |
| 122 | // Translate an offset in the input section to an offset in the output |
| 123 | // section. |
| 124 | uintX_t getOffset(uintX_t Offset); |
| 125 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 126 | ArrayRef<uint8_t> getSectionData() const; |
Rui Ueyama | 1250464 | 2015-10-27 21:51:13 +0000 | [diff] [blame] | 127 | |
Rafael Espindola | 22ef956 | 2016-04-13 01:40:19 +0000 | [diff] [blame] | 128 | void relocate(uint8_t *Buf, uint8_t *BufEnd); |
| 129 | std::vector<Relocation> Relocations; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 130 | }; |
| 131 | |
Rafael Espindola | ccfe3cb | 2016-04-04 14:04:16 +0000 | [diff] [blame] | 132 | template <class ELFT> InputSectionBase<ELFT> InputSectionBase<ELFT>::Discarded; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 133 | |
Rui Ueyama | 5a32c76 | 2016-01-06 03:16:23 +0000 | [diff] [blame] | 134 | // Usually sections are copied to the output as atomic chunks of data, |
| 135 | // but some special types of sections are split into small pieces of data |
| 136 | // and each piece is copied to a different place in the output. |
| 137 | // This class represents such special sections. |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 138 | template <class ELFT> class SplitInputSection : public InputSectionBase<ELFT> { |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 139 | typedef typename ELFT::Shdr Elf_Shdr; |
| 140 | typedef typename ELFT::uint uintX_t; |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 141 | |
| 142 | public: |
| 143 | SplitInputSection(ObjectFile<ELFT> *File, const Elf_Shdr *Header, |
| 144 | typename InputSectionBase<ELFT>::Kind SectionKind); |
Rui Ueyama | 5a32c76 | 2016-01-06 03:16:23 +0000 | [diff] [blame] | 145 | |
| 146 | // For each piece of data, we maintain the offsets in the input section and |
Peter Collingbourne | e29e142 | 2016-05-05 04:10:12 +0000 | [diff] [blame] | 147 | // in the output section. |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 148 | std::vector<std::pair<uintX_t, uintX_t>> Offsets; |
Rui Ueyama | 5a32c76 | 2016-01-06 03:16:23 +0000 | [diff] [blame] | 149 | |
Peter Collingbourne | e29e142 | 2016-05-05 04:10:12 +0000 | [diff] [blame] | 150 | // Merge input sections may use the following special values as the output |
| 151 | // section offset: |
| 152 | enum { |
| 153 | // The piece is dead. |
| 154 | PieceDead = uintX_t(-1), |
Rafael Espindola | 3e0b783 | 2016-05-05 16:12:25 +0000 | [diff] [blame] | 155 | // The piece is live, but an offset has not yet been assigned. After offsets |
Peter Collingbourne | e29e142 | 2016-05-05 04:10:12 +0000 | [diff] [blame] | 156 | // have been assigned, if the output section uses tail merging, the field |
Rafael Espindola | 3e0b783 | 2016-05-05 16:12:25 +0000 | [diff] [blame] | 157 | // will still have this value and the output section offset is computed |
| 158 | // lazilly. |
| 159 | PieceLive = uintX_t(-2), |
Peter Collingbourne | e29e142 | 2016-05-05 04:10:12 +0000 | [diff] [blame] | 160 | }; |
| 161 | |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 162 | std::pair<std::pair<uintX_t, uintX_t> *, uintX_t> |
| 163 | getRangeAndSize(uintX_t Offset); |
| 164 | }; |
| 165 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 166 | // This corresponds to a SHF_MERGE section of an input file. |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 167 | template <class ELFT> class MergeInputSection : public SplitInputSection<ELFT> { |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 168 | typedef typename ELFT::uint uintX_t; |
| 169 | typedef typename ELFT::Sym Elf_Sym; |
| 170 | typedef typename ELFT::Shdr Elf_Shdr; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 171 | |
| 172 | public: |
| 173 | MergeInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header); |
| 174 | static bool classof(const InputSectionBase<ELFT> *S); |
Rafael Espindola | f82ed2a | 2015-10-24 22:51:01 +0000 | [diff] [blame] | 175 | // Translate an offset in the input section to an offset in the output |
| 176 | // section. |
Rafael Espindola | 48225b4 | 2015-10-23 19:55:11 +0000 | [diff] [blame] | 177 | uintX_t getOffset(uintX_t Offset); |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 178 | }; |
| 179 | |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 180 | // This corresponds to a .eh_frame section of an input file. |
| 181 | template <class ELFT> class EHInputSection : public SplitInputSection<ELFT> { |
| 182 | public: |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 183 | typedef typename ELFT::Shdr Elf_Shdr; |
| 184 | typedef typename ELFT::uint uintX_t; |
Rafael Espindola | 0c6a4f1 | 2015-11-11 19:54:14 +0000 | [diff] [blame] | 185 | EHInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header); |
| 186 | static bool classof(const InputSectionBase<ELFT> *S); |
| 187 | |
| 188 | // Translate an offset in the input section to an offset in the output |
| 189 | // section. |
| 190 | uintX_t getOffset(uintX_t Offset); |
| 191 | |
| 192 | // Relocation section that refer to this one. |
| 193 | const Elf_Shdr *RelocSection = nullptr; |
| 194 | }; |
| 195 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 196 | // This corresponds to a non SHF_MERGE section of an input file. |
| 197 | template <class ELFT> class InputSection : public InputSectionBase<ELFT> { |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 198 | friend ICF<ELFT>; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 199 | typedef InputSectionBase<ELFT> Base; |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 200 | typedef typename ELFT::Shdr Elf_Shdr; |
| 201 | typedef typename ELFT::Rela Elf_Rela; |
| 202 | typedef typename ELFT::Rel Elf_Rel; |
| 203 | typedef typename ELFT::Sym Elf_Sym; |
| 204 | typedef typename ELFT::uint uintX_t; |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 205 | |
| 206 | public: |
| 207 | InputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header); |
| 208 | |
| 209 | // Write this section to a mmap'ed file, assuming Buf is pointing to |
| 210 | // beginning of the output section. |
| 211 | void writeTo(uint8_t *Buf); |
| 212 | |
Michael J. Spencer | 67bc8d6 | 2015-08-27 23:15:56 +0000 | [diff] [blame] | 213 | // Relocation sections that refer to this one. |
Rui Ueyama | c00718f | 2016-02-23 03:34:37 +0000 | [diff] [blame] | 214 | llvm::TinyPtrVector<const Elf_Shdr *> RelocSections; |
Michael J. Spencer | 67bc8d6 | 2015-08-27 23:15:56 +0000 | [diff] [blame] | 215 | |
Rui Ueyama | edffd91 | 2015-10-14 21:00:23 +0000 | [diff] [blame] | 216 | // The offset from beginning of the output sections this section was assigned |
| 217 | // to. The writer sets a value. |
Rui Ueyama | 55c3f89 | 2015-10-15 01:58:40 +0000 | [diff] [blame] | 218 | uint64_t OutSecOff = 0; |
Rui Ueyama | edffd91 | 2015-10-14 21:00:23 +0000 | [diff] [blame] | 219 | |
Rafael Espindola | c159c96 | 2015-10-19 21:00:02 +0000 | [diff] [blame] | 220 | static bool classof(const InputSectionBase<ELFT> *S); |
George Rimar | 58941ee | 2016-02-25 08:23:37 +0000 | [diff] [blame] | 221 | |
| 222 | InputSectionBase<ELFT> *getRelocatedSection(); |
| 223 | |
Simon Atanasyan | 13f6da1 | 2016-03-31 21:26:23 +0000 | [diff] [blame] | 224 | // Register thunk related to the symbol. When the section is written |
| 225 | // to a mmap'ed file, target is requested to write an actual thunk code. |
| 226 | // Now thunks is supported for MIPS target only. |
| 227 | void addThunk(SymbolBody &Body); |
| 228 | |
| 229 | // The offset of synthetic thunk code from beginning of this section. |
| 230 | uint64_t getThunkOff() const; |
| 231 | |
| 232 | // Size of chunk with thunks code. |
| 233 | uint64_t getThunksSize() const; |
| 234 | |
Rui Ueyama | 2b6fb80 | 2016-04-28 18:42:04 +0000 | [diff] [blame] | 235 | template <class RelTy> |
| 236 | void relocateNonAlloc(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels); |
| 237 | |
George Rimar | 58941ee | 2016-02-25 08:23:37 +0000 | [diff] [blame] | 238 | private: |
Rui Ueyama | fc467e7 | 2016-03-13 05:06:50 +0000 | [diff] [blame] | 239 | template <class RelTy> |
Rafael Espindola | 0f7ccc3 | 2016-04-05 14:47:28 +0000 | [diff] [blame] | 240 | void copyRelocations(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels); |
Rui Ueyama | 0b28952 | 2016-02-25 18:43:51 +0000 | [diff] [blame] | 241 | |
| 242 | // Called by ICF to merge two input sections. |
| 243 | void replace(InputSection<ELFT> *Other); |
| 244 | |
| 245 | // Used by ICF. |
| 246 | uint64_t GroupId = 0; |
Simon Atanasyan | 13f6da1 | 2016-03-31 21:26:23 +0000 | [diff] [blame] | 247 | |
| 248 | llvm::TinyPtrVector<const SymbolBody *> Thunks; |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 249 | }; |
| 250 | |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 251 | // MIPS .reginfo section provides information on the registers used by the code |
| 252 | // in the object file. Linker should collect this information and write a single |
| 253 | // .reginfo section in the output file. The output section contains a union of |
| 254 | // used registers masks taken from input .reginfo sections and final value |
| 255 | // of the `_gp` symbol. For details: Chapter 4 / "Register Information" at |
| 256 | // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf |
| 257 | template <class ELFT> |
| 258 | class MipsReginfoInputSection : public InputSectionBase<ELFT> { |
Rui Ueyama | 9328b2c | 2016-03-14 23:16:09 +0000 | [diff] [blame] | 259 | typedef typename ELFT::Shdr Elf_Shdr; |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 260 | |
| 261 | public: |
Rui Ueyama | 70eed36 | 2016-01-06 22:42:43 +0000 | [diff] [blame] | 262 | MipsReginfoInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Hdr); |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 263 | static bool classof(const InputSectionBase<ELFT> *S); |
Rui Ueyama | 70eed36 | 2016-01-06 22:42:43 +0000 | [diff] [blame] | 264 | |
Simon Atanasyan | add74f3 | 2016-05-04 10:07:38 +0000 | [diff] [blame] | 265 | const llvm::object::Elf_Mips_RegInfo<ELFT> *Reginfo = nullptr; |
| 266 | }; |
| 267 | |
| 268 | template <class ELFT> |
| 269 | class MipsOptionsInputSection : public InputSectionBase<ELFT> { |
| 270 | typedef typename ELFT::Shdr Elf_Shdr; |
| 271 | |
| 272 | public: |
| 273 | MipsOptionsInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Hdr); |
| 274 | static bool classof(const InputSectionBase<ELFT> *S); |
| 275 | |
| 276 | const llvm::object::Elf_Mips_RegInfo<ELFT> *Reginfo = nullptr; |
Simon Atanasyan | 1d7df40 | 2015-12-20 10:57:34 +0000 | [diff] [blame] | 277 | }; |
| 278 | |
Rafael Espindola | e0df00b | 2016-02-28 00:25:54 +0000 | [diff] [blame] | 279 | } // namespace elf |
Michael J. Spencer | 84487f1 | 2015-07-24 21:03:07 +0000 | [diff] [blame] | 280 | } // namespace lld |
| 281 | |
| 282 | #endif |