Handle reloc_signed_4byte in here. Not doing so was a regression from my
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 9 Dec 2011 19:57:29 +0000 (19:57 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 9 Dec 2011 19:57:29 +0000 (19:57 +0000)
previous commit. It is strange that we see it in 32 bits. We already
have a fixme about it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146273 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/ELFObjectWriter.cpp
test/MC/ELF/relocation-386.s

index 14ca509d75fd770e71fa4c965a42772fc5fbf387..40b84ae4585930fb2bb7074cb2e625d030f462c6 100644 (file)
@@ -1749,6 +1749,7 @@ unsigned X86ELFObjectWriter::GetRelocType(const MCValue &Target,
         Type = ELF::R_386_GOTPC;
         break;
 
+      case X86::reloc_signed_4byte:
       case FK_PCRel_4:
       case FK_Data_4:
         switch (Modifier) {
index 7604f9e15168c29aaf8086ed1361ec12cdb51816..85da2eb8c94950b2ac30dcd987f6162522ea909a 100644 (file)
 // CHECK-NEXT: (('r_offset', 0x00000094)
 // CHECK-NEXT:  ('r_sym', 0x00000b)
 // CHECK-NEXT:  ('r_type', 0x0a)
+// CHECK-NEXT: ),
+// Relocation 26 (und_symbol-bar2) is of type R_386_PC32
+// CHECK-NEXT: Relocation 26
+// CHECK-NEXT: (('r_offset', 0x0000009a)
+// CHECK-NEXT:  ('r_sym', 0x00000e)
+// CHECK-NEXT:  ('r_type', 0x02)
+// CHECK-NEXT: ),
 
 // Section 4 is bss
 // CHECK:      # Section 4
@@ -231,6 +238,7 @@ bar2:
         pushl $bar
         addl foo@GOTTPOFF(%edx), %eax
         subl    _GLOBAL_OFFSET_TABLE_-bar2, %ebx
+        leal und_symbol-bar2(%edx),%ecx
 
         .section        zedsec,"awT",@progbits
 zed: