summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp2
-rw-r--r--llvm/test/MC/Mips/relocation-xfail.s9
2 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
index e47868db1a4..a5e63856401 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
+++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
@@ -518,13 +518,13 @@ bool MipsELFObjectWriter::needsRelocateWithSymbol(const MCSymbol &Sym,
case ELF::R_MIPS_16:
case ELF::R_MIPS_32:
+ case ELF::R_MIPS_GPREL32:
if (cast<MCSymbolELF>(Sym).getOther() & ELF::STO_MIPS_MICROMIPS)
return true;
// fallthrough
case ELF::R_MIPS_26:
case ELF::R_MIPS_64:
case ELF::R_MIPS_GPREL16:
- case ELF::R_MIPS_GPREL32:
case ELF::R_MIPS_PC16:
case ELF::R_MIPS_SUB:
return false;
diff --git a/llvm/test/MC/Mips/relocation-xfail.s b/llvm/test/MC/Mips/relocation-xfail.s
index 0b64378c37a..2db2c469855 100644
--- a/llvm/test/MC/Mips/relocation-xfail.s
+++ b/llvm/test/MC/Mips/relocation-xfail.s
@@ -9,12 +9,21 @@
// baz is equivalent to .text+0x8 and is recorded in the symbol table as such
// but it refers to microMIPS code so the addend must indicate this in the LSB.
// The addend must therefore be 0x9.
+// DATA-LABEL: Name: .text
+// DATA: SectionData (
// DATA: 0000: 30430000 30420009
addiu $2, $3, %got(baz)
addiu $2, $2, %lo(baz)
baz:
+// DATA-LABEL: Name: .data
+// DATA: SectionData (
.data
.word 0
bar:
.word 1
+// baz is equivalent to .text+0x8 and is recorded in the symbol table as such
+// but it refers to microMIPS code so the addend must indicate this in the LSB.
+// The addend must therefore be 0x9.
+// DATA: 0000: 00000000 00000001 00000009
+ .gpword baz
OpenPOWER on IntegriCloud