summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-04-01 16:21:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-04-01 16:21:09 +0000
commit2ee00920538c0b6e7df75ac0f79f49a97b215f01 (patch)
tree0f49b87c0b1ebffe06fa68c69ef981ec22160121
parentfde7622ec06cbaba013685088146507ad6f9a755 (diff)
downloadbcm5719-llvm-2ee00920538c0b6e7df75ac0f79f49a97b215f01.tar.gz
bcm5719-llvm-2ee00920538c0b6e7df75ac0f79f49a97b215f01.zip
Don't apply a recolation that the dynamic linker will rewrite.
This matches the behavior of both bfd and gold. Looks like we just got here for mips because of a bad ordering of an if else chain. llvm-svn: 265147
-rw-r--r--lld/ELF/InputSection.cpp4
-rw-r--r--lld/test/ELF/mips-32.s4
2 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index b5448aca373..21cd7202c88 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -316,11 +316,11 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd,
} else if (Target->needsThunk(Type, *this->getFile(), Body)) {
// Get address of a thunk code related to the symbol.
SymVA = Body.getThunkVA<ELFT>();
- } else if (Config->EMachine == EM_MIPS) {
- SymVA = adjustMipsSymVA<ELFT>(Type, *File, Body, AddrLoc, SymVA);
} else if (!Target->needsCopyRel<ELFT>(Type, Body) &&
Body.isPreemptible()) {
continue;
+ } else if (Config->EMachine == EM_MIPS) {
+ SymVA = adjustMipsSymVA<ELFT>(Type, *File, Body, AddrLoc, SymVA);
}
if (Target->isSizeRel(Type))
SymVA = Body.getSize<ELFT>() + A;
diff --git a/lld/test/ELF/mips-32.s b/lld/test/ELF/mips-32.s
index 918d00d7405..5cfd556f928 100644
--- a/lld/test/ELF/mips-32.s
+++ b/lld/test/ELF/mips-32.s
@@ -32,11 +32,11 @@ v2:
.word v1 # R_MIPS_32 target v1 addend 0
# BE: Contents of section .data:
-# BE-NEXT: 30000 00000000 00030008 00030000
+# BE-NEXT: 30000 00000000 00000004 00030000
# ^-- v2+4 ^-- v1
# EL: Contents of section .data:
-# EL-NEXT: 30000 00000000 08000300 00000300
+# EL-NEXT: 30000 00000000 04000000 00000300
# ^-- v2+4 ^-- v1
# SYM: SYMBOL TABLE:
OpenPOWER on IntegriCloud