bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/19609] [2.26 Regression] Load defined symbol in non-PIC link are


From: hjl.tools at gmail dot com
Subject: [Bug ld/19609] [2.26 Regression] Load defined symbol in non-PIC link are wrongly optimized
Date: Fri, 12 Feb 2016 17:55:06 +0000

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> ---
address@hidden pr19609]$ cat y.S
        .comm pad,0x30000000,8
        .comm foo,8,8
        .text
        .globl  _start  
        .type   _start, @function
_start:
#ifdef __x86_64__
        cmpq    address@hidden(%rip), %rax
#else
        cmpl    address@hidden(%edx), %eax
#endif
        .size   _start, .-_start
address@hidden 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
address@hidden 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>
address@hidden pr19609]$ rm y.o
address@hidden 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
address@hidden pr19609]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]