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