summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@imgtec.com>2016-12-05 12:55:19 +0000
committerSimon Dardis <simon.dardis@imgtec.com>2016-12-05 12:55:19 +0000
commit8fe36cd77cb61af4b48b9ccdf8947bb04eba1d15 (patch)
treeac5e98574f0b68ca4f6032458e9cb044628e6ba3 /llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
parentf44cde8b7320933d77efbb00a9383e1a7f06617c (diff)
downloadbcm5719-llvm-8fe36cd77cb61af4b48b9ccdf8947bb04eba1d15.tar.gz
bcm5719-llvm-8fe36cd77cb61af4b48b9ccdf8947bb04eba1d15.zip
[mips][ias] N32/N64 must not sort the relocation table.
Doing so changes the evaluation order for relocation composition. Patch By: Daniel Sanders Reviewers: vkalintiris, atanasyan Differential Revision: https://reviews.llvm.org/D26401 llvm-svn: 288666
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp')
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
index 0bfd4690f47..b2efd726da5 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
+++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
@@ -419,6 +419,13 @@ unsigned MipsELFObjectWriter::getRelocType(MCContext &Ctx,
/// always match using the expressions from the source.
void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm,
std::vector<ELFRelocationEntry> &Relocs) {
+
+ // We do not need to sort the relocation table for RELA relocations which
+ // N32/N64 uses as the relocation addend contains the value we require,
+ // rather than it being split across a pair of relocations.
+ if (hasRelocationAddend())
+ return;
+
if (Relocs.size() < 2)
return;
OpenPOWER on IntegriCloud