summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2016-06-10 12:26:09 +0000
committerSimon Atanasyan <simon@atanasyan.com>2016-06-10 12:26:09 +0000
commita26a157b0a4fd687483a68bb53f085fb3e7b852d (patch)
tree34b4353e360b04f55d8532846b7e6d7a74b573f5
parentf4a5710a80c8e6a267e42e299aedcb8c3bd30fcf (diff)
downloadbcm5719-llvm-a26a157b0a4fd687483a68bb53f085fb3e7b852d.tar.gz
bcm5719-llvm-a26a157b0a4fd687483a68bb53f085fb3e7b852d.zip
[ELF][MIPS] Fix mask used to parse MIPS 3-in-1 relocation packet
In isPreemptible routine we interested in R_MIPS_GPREL16 relocation only. This relocation fits 0xf. So the new mask 0xff is just to conform the ABI specification. llvm-svn: 272388
-rw-r--r--lld/ELF/Relocations.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index d3f5ef252a5..63ed23ea8db 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -72,11 +72,11 @@ static bool isPreemptible(const SymbolBody &Body, uint32_t Type) {
// if the target symbol is preemptible. There are two two MIPS GP-relative
// relocations R_MIPS_GPREL16 and R_MIPS_GPREL32. But only R_MIPS_GPREL16
// can be against a preemptible symbol.
- // To get MIPS relocation type we apply 0xf mask. In case of O32 ABI all
+ // To get MIPS relocation type we apply 0xff mask. In case of O32 ABI all
// relocation types occupy eight bit. In case of N64 ABI we extract first
// relocation from 3-in-1 packet because only the first relocation can
// be against a real symbol.
- if (Config->EMachine == EM_MIPS && (Type & 0xf) == R_MIPS_GPREL16)
+ if (Config->EMachine == EM_MIPS && (Type & 0xff) == R_MIPS_GPREL16)
return false;
return Body.isPreemptible();
}
OpenPOWER on IntegriCloud