summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit84491abb201a2df0fadf7654e0912cb0d42a4874 (patch)
treef88946836d665690f5f0229a1ee41aa986a4a25d /llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
parent33e529d56b2ff4b19357ed2d874fe5bb87f98052 (diff)
downloadbcm5719-llvm-84491abb201a2df0fadf7654e0912cb0d42a4874.tar.gz
bcm5719-llvm-84491abb201a2df0fadf7654e0912cb0d42a4874.zip
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 ]. llvm-svn: 161348
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp')
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
index 77c1524531c..1ff304494e7 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud