[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/12186] New: "add ebx, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_" is inc
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gas/12186] New: "add ebx, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_" is incorrectly assembled |
Date: |
Wed, 3 Nov 2010 14:02:51 +0000 |
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: address@hidden
ReportedBy: address@hidden
address@hidden pr46275]$ cat p.c
#include <stdio.h>
int main()
{ puts("Hello, world!"); return 0; }
address@hidden pr46275]$ make
gcc -m32 -masm=intel -fPIC -S p.c
gcc -m32 -o p p.s
./p
address@hidden 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 gas/12186] New: "add ebx, OFFSET FLAT:_GLOBAL_OFFSET_TABLE_" is incorrectly assembled,
hjl.tools at gmail dot com <=