aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
diff options
context:
space:
mode:
authorJack Carter <jcarter@mips.com>2012-08-06 21:26:03 +0000
committerJack Carter <jcarter@mips.com>2012-08-06 21:26:03 +0000
commitfc54d9e47a1276650f14f38e7d037c9b58c8dc2d (patch)
treebbf0805bc17a035e6d50d6ecce00c63bc07fed7e /lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
parentf45717e985260e9416dbd2fe8df471d48705c86a (diff)
Mips relocations R_MIPS_HIGHER and R_MIPS_HIGHEST.
These 2 relocations gain access to the highest and the second highest 16 bits of a 64 bit object. R_MIPS_HIGHER %higher(A+S) The %higher(x) function is [ (((long long) x + 0x80008000LL) >> 32) & 0xffff ]. R_MIPS_HIGHEST %highest(A+S) The %highest(x) function is [ (((long long) x + 0x800080008000LL) >> 48) & 0xffff ]. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp')
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
index 77c1524531..1ff304494e 100644
--- a/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
+++ b/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
@@ -169,6 +169,12 @@ unsigned MipsELFObjectWriter::GetRelocType(const MCValue &Target,
Type = setRType2((unsigned)ELF::R_MIPS_SUB, Type);
Type = setRType3((unsigned)ELF::R_MIPS_LO16, Type);
break;
+ case Mips::fixup_Mips_HIGHER:
+ Type = ELF::R_MIPS_HIGHER;
+ break;
+ case Mips::fixup_Mips_HIGHEST:
+ Type = ELF::R_MIPS_HIGHEST;
+ break;
}
return Type;
}