https://sourceware.org/bugzilla/show_bug.cgi?id=19609
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |2.26
Summary|Load weak undefined symbol |[2.26 Regression] Load
|and defined symbol in |defined symbol in non-PIC
|non-PIC link aren't |link are wrongly optimized
|optimized |
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
[hjl@gnu-6 pr19609]$ cat y.S
.comm pad,0x30000000,8
.comm foo,8,8
.text
.globl _start
.type _start, @function
_start:
#ifdef __x86_64__
cmpq foo@GOTPCREL(%rip), %rax
#else
cmpl foo@GOT(%edx), %eax
#endif
.size _start, .-_start
[hjl@gnu-6 pr19609]$ make LD=./ld-2.25 y
gcc -B./ -Wa,-mrelax-relocations=no -c -o y.o y.S
./ld-2.25 -Ttext=0x70000000 -o y y.o
[hjl@gnu-6 pr19609]$ objdump -d y
y: file format elf64-x86-64
Disassembly of section .text:
0000000070000000 <_start>:
70000000: 48 3b 05 01 00 20 00 cmp 0x200001(%rip),%rax #
70200008 <_start+0x200008>
[hjl@gnu-6 pr19609]$ rm y.o
[hjl@gnu-6 pr19609]$ make LD=ld
gcc -B./ -c -o x.o x.S
ld -o x x.o
gcc -B./ -c -o y.o y.S
ld -Ttext=0x70000000 -o y y.o
y.o: In function `_start':
(.text+0x3): relocation truncated to fit: R_X86_64_32S against symbol `foo'
defined in COMMON section in y.o
Makefile:24: recipe for target 'y' failed
make: *** [y] Error 1
[hjl@gnu-6 pr19609]$
--
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