https://sourceware.org/bugzilla/show_bug.cgi?id=20244
Bug ID: 20244
Summary: ld fails to handle "op $imm, bar@GOT"
Product: binutils
Version: 2.27 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
Target: i386
[hjl@gnu-tools-1 got-4]$ cat x.S
.data
.type bar, @object
bar:
.byte 1
.size bar, .-bar
.globl foo
.type foo, @object
foo:
.byte 1
.size foo, .-foo
.text
.globl _start
.type _start, @function
_start:
movl $0, bar@GOT
movl $0, foo@GOT
[hjl@gnu-tools-1 got-4]$ make LD=ld
gcc -B./ -m32 -fno-lto -c -o x.o x.S
ld -m elf_i386 -o x x.o
./objdump -dwr x
x: file format elf32-i386
Disassembly of section .text:
08048074 <_start>:
8048074: c7 05 f8 ff ff ff 00 00 00 00 movl $0x0,0xfffffff8
804807e: c7 05 fc ff ff ff 00 00 00 00 movl $0x0,0xfffffffc
[hjl@gnu-tools-1 got-4]$
bar@GOT should be the memory address, not the offset from GOT base.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils