[llvm] r269410 - [mips][ias] Work around yet another incorrect microMIPS relocation evaluation exposed by r268900.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 05:07:14 PDT 2016


Author: dsanders
Date: Fri May 13 07:07:14 2016
New Revision: 269410

URL: http://llvm.org/viewvc/llvm-project?rev=269410&view=rev
Log:
[mips][ias] Work around yet another incorrect microMIPS relocation evaluation exposed by r268900.

It's not entirely clear why R_MICROMIPS_(GOT|HI16|LO16) are evaluated
incorrectly in a small number of the LNT tests at this point. However, it's not
related to the STO_MIPS_MICROMIPS issue.

At this point all the microMIPS-related changes of r268900 have been reverted.

Modified:
    llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
    llvm/trunk/test/MC/Mips/relocation-xfail.s

Modified: llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp?rev=269410&r1=269409&r2=269410&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp Fri May 13 07:07:14 2016
@@ -502,13 +502,10 @@ bool MipsELFObjectWriter::needsRelocateW
   // are not supported yet but can be added as required.
   case ELF::R_MIPS_GOT16:
   case ELF::R_MIPS16_GOT16:
-  case ELF::R_MICROMIPS_GOT16:
   case ELF::R_MIPS_HI16:
   case ELF::R_MIPS16_HI16:
-  case ELF::R_MICROMIPS_HI16:
   case ELF::R_MIPS_LO16:
   case ELF::R_MIPS16_LO16:
-  case ELF::R_MICROMIPS_LO16:
     // FIXME: It should be safe to return false for the STO_MIPS_MICROMIPS but
     //        we neglect to handle the adjustment to the LSB of the addend that
     //        it causes in applyFixup() and similar.
@@ -516,6 +513,13 @@ bool MipsELFObjectWriter::needsRelocateW
       return true;
     return false;
 
+  // FIXME: These three belong in the previous group but applyFixup() and
+  //        similar do not get the addend correct at the moment.
+  case ELF::R_MICROMIPS_GOT16:
+  case ELF::R_MICROMIPS_HI16:
+  case ELF::R_MICROMIPS_LO16:
+    return true;
+
   case ELF::R_MIPS_16:
   case ELF::R_MIPS_32:
   case ELF::R_MIPS_GPREL32:

Modified: llvm/trunk/test/MC/Mips/relocation-xfail.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/relocation-xfail.s?rev=269410&r1=269409&r2=269410&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/relocation-xfail.s (original)
+++ llvm/trunk/test/MC/Mips/relocation-xfail.s Fri May 13 07:07:14 2016
@@ -11,10 +11,12 @@
 // The addend must therefore be 0x9.
 // DATA-LABEL: Name: .text
 // DATA:       SectionData (
-// DATA:       0000: 30430000 30420009
+// DATA:       0000: 30430000 30420009 30430000 30420009
         addiu $2, $3, %got(baz)
         addiu $2, $2, %lo(baz)
 baz:
+        addiu $2, $3, %hi(baz)
+        addiu $2, $2, %lo(baz)
 
 // DATA-LABEL: Name: .data
 // DATA:       SectionData (




More information about the llvm-commits mailing list