[llvm] r205200 - [mips] Implement missing relocations in the integrated assembler.
Daniel Sanders
daniel.sanders at imgtec.com
Mon Mar 31 08:15:03 PDT 2014
Author: dsanders
Date: Mon Mar 31 10:15:02 2014
New Revision: 205200
URL: http://llvm.org/viewvc/llvm-project?rev=205200&view=rev
Log:
[mips] Implement missing relocations in the integrated assembler.
%got_hi, %got_lo, %call_hi, %call_lo, %higher, and %highest are now recognised
by MipsAsmParser::getVariantKind().
To prevent future issues with missing entries in this StringSwitch, I've added
an assertion to the default case.
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/trunk/test/MC/Mips/xgot.s
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=205200&r1=205199&r2=205200&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Mon Mar 31 10:15:02 2014
@@ -2277,8 +2277,16 @@ MCSymbolRefExpr::VariantKind MipsAsmPars
.Case("got_ofst", MCSymbolRefExpr::VK_Mips_GOT_OFST)
.Case("hi(%neg(%gp_rel", MCSymbolRefExpr::VK_Mips_GPOFF_HI)
.Case("lo(%neg(%gp_rel", MCSymbolRefExpr::VK_Mips_GPOFF_LO)
+ .Case("got_hi", MCSymbolRefExpr::VK_Mips_GOT_HI16)
+ .Case("got_lo", MCSymbolRefExpr::VK_Mips_GOT_LO16)
+ .Case("call_hi", MCSymbolRefExpr::VK_Mips_CALL_HI16)
+ .Case("call_lo", MCSymbolRefExpr::VK_Mips_CALL_LO16)
+ .Case("higher", MCSymbolRefExpr::VK_Mips_HIGHER)
+ .Case("highest", MCSymbolRefExpr::VK_Mips_HIGHEST)
.Default(MCSymbolRefExpr::VK_None);
+ assert (VK != MCSymbolRefExpr::VK_None);
+
return VK;
}
Modified: llvm/trunk/test/MC/Mips/xgot.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/xgot.s?rev=205200&r1=205199&r2=205200&view=diff
==============================================================================
--- llvm/trunk/test/MC/Mips/xgot.s (original)
+++ llvm/trunk/test/MC/Mips/xgot.s Mon Mar 31 10:15:02 2014
@@ -1,8 +1,5 @@
// RUN: llvm-mc -filetype=obj -triple mipsel-unknown-linux %s -o - | llvm-readobj -r | FileCheck %s
-// Expected failure since the mips backend can't handle this yet.
-// XFAIL: *
-
// Check that the appropriate relocations were created.
// For the xgot case we want to see R_MIPS_[GOT|CALL]_[HI|LO]16.
@@ -12,8 +9,8 @@
// CHECK: 0x{{[0-9,A-F]+}} R_MIPS_GOT_HI16
// CHECK: 0x{{[0-9,A-F]+}} R_MIPS_GOT_LO16
// CHECK: 0x{{[0-9,A-F]+}} R_MIPS_CALL_HI16
-// CHECK: 0x{{[0-9,A-F]+}} R_MIPS_CALL_LO16
// CHECK: 0x{{[0-9,A-F]+}} R_MIPS_GOT16
+// CHECK: 0x{{[0-9,A-F]+}} R_MIPS_CALL_LO16
// CHECK: 0x{{[0-9,A-F]+}} R_MIPS_LO16
// CHECK: ]
More information about the llvm-commits
mailing list