[llvm-commits] [llvm] r135607 - in /llvm/trunk: lib/Target/X86/X86MCCodeEmitter.cpp test/MC/ELF/global-offset.s

Eli Friedman eli.friedman at gmail.com
Wed Jul 20 12:36:11 PDT 2011


Author: efriedma
Date: Wed Jul 20 14:36:11 2011
New Revision: 135607

URL: http://llvm.org/viewvc/llvm-project?rev=135607&view=rev
Log:
Extend the hack for _GLOBAL_OFFSET_TABLE_ slightly; PR10389.


Modified:
    llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
    llvm/trunk/test/MC/ELF/global-offset.s

Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=135607&r1=135606&r2=135607&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Wed Jul 20 14:36:11 2011
@@ -205,7 +205,9 @@
   }
 
   // If we have an immoffset, add it to the expression.
-  if (FixupKind == FK_Data_4 && StartsWithGlobalOffsetTable(Expr)) {
+  if ((FixupKind == FK_Data_4 ||
+       FixupKind == MCFixupKind(X86::reloc_signed_4byte)) &&
+      StartsWithGlobalOffsetTable(Expr)) {
     assert(ImmOffset == 0);
 
     FixupKind = MCFixupKind(X86::reloc_global_offset_table);

Modified: llvm/trunk/test/MC/ELF/global-offset.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/global-offset.s?rev=135607&r1=135606&r2=135607&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/global-offset.s (original)
+++ llvm/trunk/test/MC/ELF/global-offset.s Wed Jul 20 14:36:11 2011
@@ -1,9 +1,10 @@
 // RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu %s -o - | elf-dump  --dump-section-data | FileCheck  %s
 
 // We test that _GLOBAL_OFFSET_TABLE_ will account for the two bytes at the
-// start of the addl.
+// start of the addl/leal.
 
         addl    $_GLOBAL_OFFSET_TABLE_, %ebx
+        leal    _GLOBAL_OFFSET_TABLE_(%ebx), %ebx
 
 // CHECK:      ('sh_name', 0x00000005) # '.text'
 // CHECK-NEXT: ('sh_type',
@@ -15,4 +16,4 @@
 // CHECK-NEXT: ('sh_info',
 // CHECK-NEXT: ('sh_addralign',
 // CHECK-NEXT: ('sh_entsize',
-// CHECK-NEXT: ('_section_data', '81c30200 0000')
+// CHECK-NEXT: ('_section_data', '81c30200 00008d9b 02000000')





More information about the llvm-commits mailing list