http://sourceware.org/bugzilla/show_bug.cgi?id=12186
Summary: "add ebx, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_" is incorrectly assembled Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gas AssignedTo: unassig...@sources.redhat.com ReportedBy: hjl.to...@gmail.com [...@gnu-6 pr46275]$ cat p.c #include <stdio.h> int main() { puts("Hello, world!"); return 0; } [...@gnu-6 pr46275]$ make gcc -m32 -masm=intel -fPIC -S p.c gcc -m32 -o p p.s ./p [...@gnu-6 pr46275]$ For some reason, the addend in R_386_GOTPC reloc is missing when compiled with -masm=intel. The objdump difference between -masm=att [hello.o] that works and -masm=intel [hello_.o] that fails is: @@ -1,5 +1,5 @@ -hello.o: file format elf32-i386 +hello_.o: file format elf32-i386 Disassembly of section .text: @@ -12,7 +12,7 @@ 7: 83 ec 1c sub $0x1c,%esp a: e8 fc ff ff ff call b <main+0xb> b: R_386_PC32 __i686.get_pc_thunk.bx - f: 81 c3 02 00 00 00 add $0x2,%ebx + f: 81 c3 00 00 00 00 add $0x0,%ebx 11: R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 15: 8d 83 00 00 00 00 lea 0x0(%ebx),%eax 17: R_386_GOTOFF .rodata -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils