summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-03-29 18:18:19 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-03-29 18:18:19 +0000
commitcba3e8b4b5d471acda77cb1d5df4c158365b0788 (patch)
tree51887971f32ff98f5ceeac849dd42b0bbbc22578
parentff6d0d8b2e6644c9c98650ce5a5d33b025518aa4 (diff)
downloadbcm5719-llvm-cba3e8b4b5d471acda77cb1d5df4c158365b0788.tar.gz
bcm5719-llvm-cba3e8b4b5d471acda77cb1d5df4c158365b0788.zip
Change how we handle R_MIPS_LO16.
Mips aligns PT_LOAD to 16 bits (0x10000). That means that the lower 16 bits are always the same, so we can, effectively, say that the relocation is relative. llvm-svn: 264761
-rw-r--r--lld/ELF/Target.cpp1
-rw-r--r--lld/ELF/Writer.cpp9
2 files changed, 0 insertions, 10 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 4f87aac261e..998ad4fc217 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -1819,7 +1819,6 @@ bool MipsTargetInfo<ELFT>::isRelRelative(uint32_t Type) const {
case R_MIPS_32:
case R_MIPS_64:
case R_MIPS_HI16:
- case R_MIPS_LO16:
case R_MIPS_TLS_DTPREL_HI16:
case R_MIPS_TLS_DTPREL_LO16:
case R_MIPS_TLS_TPREL_HI16:
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 2048a8e22ed..4e24588c4b9 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -432,15 +432,6 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C,
}
if (Config->EMachine == EM_MIPS) {
- if (Type == R_MIPS_LO16)
- // Ignore R_MIPS_LO16 relocation. If it is a pair for R_MIPS_GOT16 we
- // already completed all required action (GOT entry allocation) when
- // handle R_MIPS_GOT16a. If it is a pair for R_MIPS_HI16 against
- // _gp_disp it does not require dynamic relocation. If its a pair for
- // R_MIPS_HI16 against a regular symbol it does not require dynamic
- // relocation too because that case is possible for executable file
- // linking only.
- continue;
if (&Body == Config->MipsGpDisp || &Body == Config->MipsLocalGp)
// MIPS _gp_disp designates offset between start of function and 'gp'
// pointer into GOT. __gnu_local_gp is equal to the current value of
OpenPOWER on IntegriCloud