Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 1 | //===- Target.cpp ---------------------------------------------------------===// |
| 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 | #include "Target.h" |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 11 | #include "Error.h" |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 12 | #include "Symbols.h" |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 13 | |
| 14 | #include "llvm/ADT/ArrayRef.h" |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 15 | #include "llvm/Object/ELF.h" |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 16 | #include "llvm/Support/Endian.h" |
| 17 | #include "llvm/Support/ELF.h" |
| 18 | |
| 19 | using namespace llvm; |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 20 | using namespace llvm::object; |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 21 | using namespace llvm::support::endian; |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 22 | using namespace llvm::ELF; |
| 23 | |
| 24 | namespace lld { |
| 25 | namespace elf2 { |
| 26 | |
| 27 | std::unique_ptr<TargetInfo> Target; |
| 28 | |
| 29 | TargetInfo::~TargetInfo() {} |
| 30 | |
Rafael Espindola | 6d7fcdb | 2015-09-29 13:36:32 +0000 | [diff] [blame] | 31 | bool TargetInfo::relocPointsToGot(uint32_t Type) const { return false; } |
| 32 | |
Rafael Espindola | 7f07442 | 2015-09-22 21:35:51 +0000 | [diff] [blame] | 33 | X86TargetInfo::X86TargetInfo() { |
| 34 | PCRelReloc = R_386_PC32; |
| 35 | GotReloc = R_386_GLOB_DAT; |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 36 | GotRefReloc = R_386_GOT32; |
Rafael Espindola | 7f07442 | 2015-09-22 21:35:51 +0000 | [diff] [blame] | 37 | } |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 38 | |
| 39 | void X86TargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, |
| 40 | uint64_t PltEntryAddr) const { |
Rui Ueyama | 1500a90 | 2015-09-29 23:00:47 +0000 | [diff] [blame] | 41 | // jmpl *val; nop; nop |
| 42 | const uint8_t Inst[] = {0xff, 0x25, 0, 0, 0, 0, 0x90, 0x90}; |
| 43 | memcpy(Buf, Inst, sizeof(Inst)); |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 44 | assert(isUInt<32>(GotEntryAddr)); |
Rui Ueyama | 1500a90 | 2015-09-29 23:00:47 +0000 | [diff] [blame] | 45 | write32le(Buf + 2, GotEntryAddr); |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 46 | } |
| 47 | |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 48 | bool X86TargetInfo::relocNeedsGot(uint32_t Type, const SymbolBody &S) const { |
| 49 | if (relocNeedsPlt(Type, S)) |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 50 | return true; |
| 51 | switch (Type) { |
| 52 | default: |
| 53 | return false; |
| 54 | case R_386_GOT32: |
| 55 | return true; |
| 56 | } |
| 57 | } |
| 58 | |
Rafael Espindola | 6d7fcdb | 2015-09-29 13:36:32 +0000 | [diff] [blame] | 59 | bool X86TargetInfo::relocPointsToGot(uint32_t Type) const { |
| 60 | return Type == R_386_GOTPC; |
| 61 | } |
| 62 | |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 63 | bool X86TargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const { |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 64 | switch (Type) { |
| 65 | default: |
| 66 | return false; |
| 67 | case R_386_PLT32: |
| 68 | return true; |
| 69 | } |
| 70 | } |
| 71 | |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 72 | static void add32le(uint8_t *P, int32_t V) { write32le(P, read32le(P) + V); } |
| 73 | |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 74 | void X86TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type, |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 75 | uint64_t BaseAddr, uint64_t SymVA, |
| 76 | uint64_t GotVA) const { |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 77 | typedef ELFFile<ELF32LE>::Elf_Rel Elf_Rel; |
| 78 | auto &Rel = *reinterpret_cast<const Elf_Rel *>(RelP); |
| 79 | |
| 80 | uint32_t Offset = Rel.r_offset; |
| 81 | uint8_t *Location = Buf + Offset; |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 82 | switch (Type) { |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 83 | case R_386_GOT32: |
| 84 | add32le(Location, SymVA - GotVA); |
| 85 | break; |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 86 | case R_386_PC32: |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 87 | add32le(Location, SymVA - (BaseAddr + Offset)); |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 88 | break; |
| 89 | case R_386_32: |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 90 | add32le(Location, SymVA); |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 91 | break; |
| 92 | default: |
| 93 | error(Twine("unrecognized reloc ") + Twine(Type)); |
| 94 | break; |
| 95 | } |
| 96 | } |
| 97 | |
Rafael Espindola | 7f07442 | 2015-09-22 21:35:51 +0000 | [diff] [blame] | 98 | X86_64TargetInfo::X86_64TargetInfo() { |
| 99 | PCRelReloc = R_X86_64_PC32; |
| 100 | GotReloc = R_X86_64_GLOB_DAT; |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 101 | GotRefReloc = R_X86_64_PC32; |
Rafael Espindola | 7f07442 | 2015-09-22 21:35:51 +0000 | [diff] [blame] | 102 | } |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 103 | |
| 104 | void X86_64TargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, |
| 105 | uint64_t PltEntryAddr) const { |
Rui Ueyama | 1500a90 | 2015-09-29 23:00:47 +0000 | [diff] [blame] | 106 | // jmpq *val(%rip); nop; nop |
| 107 | const uint8_t Inst[] = {0xff, 0x25, 0, 0, 0, 0, 0x90, 0x90}; |
| 108 | memcpy(Buf, Inst, sizeof(Inst)); |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 109 | |
| 110 | uintptr_t NextPC = PltEntryAddr + 6; |
Rafael Espindola | 8c21fad | 2015-09-22 20:06:19 +0000 | [diff] [blame] | 111 | intptr_t Delta = GotEntryAddr - NextPC; |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 112 | assert(isInt<32>(Delta)); |
Rui Ueyama | 1500a90 | 2015-09-29 23:00:47 +0000 | [diff] [blame] | 113 | write32le(Buf + 2, Delta); |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 114 | } |
| 115 | |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 116 | bool X86_64TargetInfo::relocNeedsGot(uint32_t Type, const SymbolBody &S) const { |
| 117 | if (relocNeedsPlt(Type, S)) |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 118 | return true; |
| 119 | switch (Type) { |
| 120 | default: |
| 121 | return false; |
| 122 | case R_X86_64_GOTPCREL: |
| 123 | return true; |
| 124 | } |
| 125 | } |
| 126 | |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 127 | bool X86_64TargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const { |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 128 | switch (Type) { |
| 129 | default: |
| 130 | return false; |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 131 | case R_X86_64_PC32: |
| 132 | // This relocation is defined to have a value of (S + A - P). |
| 133 | // The problems start when a non PIC program calls a function is a shared |
| 134 | // library. |
| 135 | // In an idea world, we could just report an error saying the relocation |
| 136 | // can overflow at runtime. |
| 137 | // In the real world, crt1.o has a R_X86_64_PC32 pointing to libc.so. |
| 138 | // The general idea is to create a PLT entry and use that as the function |
| 139 | // value, which is why we return true in here. |
| 140 | // The remaining (unimplemented) problem is making sure pointer equality |
| 141 | // still works. For that, we need the help of the dynamic linker. We |
| 142 | // let it know that we have a direct reference to a symbol by creating |
| 143 | // an undefined symbol with a non zero st_value. Seeing that the |
| 144 | // dynamic linker resolves the symbol to the value of the symbol we created. |
| 145 | // This is true even for got entries, so pointer equality is maintained. |
| 146 | // To avoid an infinite loop, the only entry that points to the |
| 147 | // real function is a dedicated got entry used by the plt. |
| 148 | return S.isShared(); |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 149 | case R_X86_64_PLT32: |
| 150 | return true; |
| 151 | } |
| 152 | } |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 153 | |
| 154 | void X86_64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, |
| 155 | uint32_t Type, uint64_t BaseAddr, |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 156 | uint64_t SymVA, uint64_t GotVA) const { |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 157 | typedef ELFFile<ELF64LE>::Elf_Rela Elf_Rela; |
| 158 | auto &Rel = *reinterpret_cast<const Elf_Rela *>(RelP); |
| 159 | |
| 160 | uint64_t Offset = Rel.r_offset; |
| 161 | uint8_t *Location = Buf + Offset; |
| 162 | switch (Type) { |
| 163 | case R_X86_64_PC32: |
Rafael Espindola | cdfecff | 2015-09-23 20:08:25 +0000 | [diff] [blame] | 164 | case R_X86_64_GOTPCREL: |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 165 | write32le(Location, SymVA + Rel.r_addend - (BaseAddr + Offset)); |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 166 | break; |
| 167 | case R_X86_64_64: |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 168 | write64le(Location, SymVA + Rel.r_addend); |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 169 | break; |
| 170 | case R_X86_64_32: { |
| 171 | case R_X86_64_32S: |
| 172 | uint64_t VA = SymVA + Rel.r_addend; |
| 173 | if (Type == R_X86_64_32 && !isUInt<32>(VA)) |
| 174 | error("R_X86_64_32 out of range"); |
| 175 | else if (!isInt<32>(VA)) |
| 176 | error("R_X86_64_32S out of range"); |
| 177 | |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 178 | write32le(Location, VA); |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 179 | break; |
| 180 | } |
| 181 | default: |
| 182 | error(Twine("unrecognized reloc ") + Twine(Type)); |
| 183 | break; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | PPC64TargetInfo::PPC64TargetInfo() { |
| 188 | // PCRelReloc = FIXME |
Rafael Espindola | 7f07442 | 2015-09-22 21:35:51 +0000 | [diff] [blame] | 189 | // GotReloc = FIXME |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 190 | } |
| 191 | void PPC64TargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, |
| 192 | uint64_t PltEntryAddr) const {} |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 193 | bool PPC64TargetInfo::relocNeedsGot(uint32_t Type, const SymbolBody &S) const { |
| 194 | return false; |
| 195 | } |
| 196 | bool PPC64TargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const { |
| 197 | return false; |
| 198 | } |
Rafael Espindola | c401088 | 2015-09-22 20:54:08 +0000 | [diff] [blame] | 199 | void PPC64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type, |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 200 | uint64_t BaseAddr, uint64_t SymVA, |
| 201 | uint64_t GotVA) const { |
Rafael Espindola | 3efa4e9 | 2015-09-22 21:12:55 +0000 | [diff] [blame] | 202 | typedef ELFFile<ELF64BE>::Elf_Rela Elf_Rela; |
| 203 | auto &Rel = *reinterpret_cast<const Elf_Rela *>(RelP); |
| 204 | |
| 205 | uint64_t Offset = Rel.r_offset; |
| 206 | uint8_t *Location = Buf + Offset; |
| 207 | switch (Type) { |
| 208 | case R_PPC64_ADDR64: |
Rafael Espindola | 0872ea3 | 2015-09-24 14:16:02 +0000 | [diff] [blame] | 209 | write64be(Location, SymVA + Rel.r_addend); |
Rafael Espindola | 3efa4e9 | 2015-09-22 21:12:55 +0000 | [diff] [blame] | 210 | break; |
| 211 | case R_PPC64_TOC: |
| 212 | // We don't create a TOC yet. |
| 213 | break; |
| 214 | default: |
| 215 | error(Twine("unrecognized reloc ") + Twine(Type)); |
| 216 | break; |
| 217 | } |
| 218 | } |
Rafael Espindola | 1d6063e | 2015-09-22 21:24:52 +0000 | [diff] [blame] | 219 | |
| 220 | PPCTargetInfo::PPCTargetInfo() { |
| 221 | // PCRelReloc = FIXME |
Rafael Espindola | 7f07442 | 2015-09-22 21:35:51 +0000 | [diff] [blame] | 222 | // GotReloc = FIXME |
Rafael Espindola | 1d6063e | 2015-09-22 21:24:52 +0000 | [diff] [blame] | 223 | } |
| 224 | void PPCTargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, |
| 225 | uint64_t PltEntryAddr) const {} |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 226 | bool PPCTargetInfo::relocNeedsGot(uint32_t Type, const SymbolBody &S) const { |
| 227 | return false; |
| 228 | } |
| 229 | bool PPCTargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const { |
| 230 | return false; |
| 231 | } |
Rafael Espindola | 1d6063e | 2015-09-22 21:24:52 +0000 | [diff] [blame] | 232 | void PPCTargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type, |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 233 | uint64_t BaseAddr, uint64_t SymVA, |
| 234 | uint64_t GotVA) const {} |
Rafael Espindola | 1d6063e | 2015-09-22 21:24:52 +0000 | [diff] [blame] | 235 | |
| 236 | ARMTargetInfo::ARMTargetInfo() { |
| 237 | // PCRelReloc = FIXME |
Rafael Espindola | 7f07442 | 2015-09-22 21:35:51 +0000 | [diff] [blame] | 238 | // GotReloc = FIXME |
Rafael Espindola | 1d6063e | 2015-09-22 21:24:52 +0000 | [diff] [blame] | 239 | } |
| 240 | void ARMTargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, |
| 241 | uint64_t PltEntryAddr) const {} |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 242 | bool ARMTargetInfo::relocNeedsGot(uint32_t Type, const SymbolBody &S) const { |
| 243 | return false; |
| 244 | } |
| 245 | bool ARMTargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const { |
| 246 | return false; |
| 247 | } |
Rafael Espindola | 1d6063e | 2015-09-22 21:24:52 +0000 | [diff] [blame] | 248 | void ARMTargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type, |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 249 | uint64_t BaseAddr, uint64_t SymVA, |
| 250 | uint64_t GotVA) const {} |
Davide Italiano | cde9336 | 2015-09-26 00:32:04 +0000 | [diff] [blame] | 251 | |
| 252 | AArch64TargetInfo::AArch64TargetInfo() { |
| 253 | // PCRelReloc = FIXME |
| 254 | // GotReloc = FIXME |
| 255 | } |
| 256 | void AArch64TargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, |
| 257 | uint64_t PltEntryAddr) const {} |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 258 | bool AArch64TargetInfo::relocNeedsGot(uint32_t Type, |
| 259 | const SymbolBody &S) const { |
| 260 | return false; |
| 261 | } |
| 262 | bool AArch64TargetInfo::relocNeedsPlt(uint32_t Type, |
| 263 | const SymbolBody &S) const { |
| 264 | return false; |
| 265 | } |
Davide Italiano | 1d750a6 | 2015-09-27 08:45:38 +0000 | [diff] [blame] | 266 | |
| 267 | static void handle_ADR_PREL_LO21(uint8_t *Location, uint64_t S, int64_t A, |
| 268 | uint64_t P) { |
| 269 | uint64_t X = S + A - P; |
| 270 | if (!isInt<21>(X)) |
| 271 | error("Relocation R_AARCH64_ADR_PREL_LO21 out of range"); |
| 272 | uint32_t Imm = X & 0x1FFFFF; |
| 273 | uint32_t ImmLo = (Imm & 0x3) << 29; |
| 274 | uint32_t ImmHi = ((Imm & 0x1FFFFC) >> 2) << 5; |
| 275 | uint64_t Mask = (0x3 << 29) | (0x7FFFF << 5); |
| 276 | write32le(Location, (read32le(Location) & ~Mask) | ImmLo | ImmHi); |
| 277 | } |
| 278 | |
Davide Italiano | cde9336 | 2015-09-26 00:32:04 +0000 | [diff] [blame] | 279 | void AArch64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, |
| 280 | uint32_t Type, uint64_t BaseAddr, |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 281 | uint64_t SymVA, uint64_t GotVA) const { |
Davide Italiano | 1d750a6 | 2015-09-27 08:45:38 +0000 | [diff] [blame] | 282 | typedef ELFFile<ELF64LE>::Elf_Rela Elf_Rela; |
| 283 | auto &Rel = *reinterpret_cast<const Elf_Rela *>(RelP); |
| 284 | |
| 285 | uint8_t *Location = Buf + Rel.r_offset; |
| 286 | uint64_t S = SymVA; |
| 287 | int64_t A = Rel.r_addend; |
| 288 | uint64_t P = BaseAddr + Rel.r_offset; |
| 289 | switch (Type) { |
| 290 | case R_AARCH64_ADR_PREL_LO21: |
| 291 | handle_ADR_PREL_LO21(Location, S, A, P); |
| 292 | break; |
| 293 | default: |
| 294 | error(Twine("unrecognized reloc ") + Twine(Type)); |
| 295 | break; |
| 296 | } |
| 297 | } |
Simon Atanasyan | 49829a1 | 2015-09-29 05:34:03 +0000 | [diff] [blame] | 298 | |
| 299 | MipsTargetInfo::MipsTargetInfo() { |
| 300 | // PCRelReloc = FIXME |
| 301 | // GotReloc = FIXME |
| 302 | DefaultEntry = "__start"; |
| 303 | } |
| 304 | |
| 305 | void MipsTargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, |
| 306 | uint64_t PltEntryAddr) const {} |
| 307 | |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 308 | bool MipsTargetInfo::relocNeedsGot(uint32_t Type, const SymbolBody &S) const { |
| 309 | return false; |
| 310 | } |
Simon Atanasyan | 49829a1 | 2015-09-29 05:34:03 +0000 | [diff] [blame] | 311 | |
Rafael Espindola | 3ef3a4c | 2015-09-29 23:22:16 +0000 | [diff] [blame^] | 312 | bool MipsTargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const { |
| 313 | return false; |
| 314 | } |
Simon Atanasyan | 49829a1 | 2015-09-29 05:34:03 +0000 | [diff] [blame] | 315 | |
| 316 | void MipsTargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type, |
Rafael Espindola | 8acb95c | 2015-09-29 14:42:37 +0000 | [diff] [blame] | 317 | uint64_t BaseAddr, uint64_t SymVA, |
| 318 | uint64_t GotVA) const {} |
Rafael Espindola | 01205f7 | 2015-09-22 18:19:46 +0000 | [diff] [blame] | 319 | } |
| 320 | } |