bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/22126] [2.29 Regression] ld --unresolved-symbols ignore-all does


From: hjl.tools at gmail dot com
Subject: [Bug ld/22126] [2.29 Regression] ld --unresolved-symbols ignore-all doesn't create a reference to undefined symbols
Date: Tue, 12 Sep 2017 15:17:36 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22126

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Matthias Klose from comment #0)
> this is a test case from the 'adequate' testsuite trying to construct a

What is the purpose of this test?

> binary with an unresolved symbol. This worked with 2.28, and works in 2.29

Are you sure it works with 2.28?  I got

address@hidden pr22126]$ cat x.s
        .text
        .globl _start
_start:
        .dc.a this_symbol_might_be_undefined
address@hidden pr22126]$ make LD=./ld-2.28
as   -o x.o x.s
./ld-2.28 --unresolved-symbols=ignore-all -o x x.o
nm x
000000000060007d T __bss_start
000000000060007d T _edata
0000000000600080 T _end
0000000000400078 T _start
address@hidden pr22126]$ ./ld-2.28 -v
GNU ld (GNU Binutils) 2.28.2.20170706
address@hidden pr22126]$ 

> on non-x86 architectures.
> 
> $ cat undef.c        
> extern void this_symbol_might_be_undefined(void);
> 
> int main(int argc, char **argv)
> {
>         this_symbol_might_be_undefined();
>         return 0;
> }
> 
> $ gcc -no-pie -fno-PIE -Wl,--unresolved-symbols,ignore-all -o my-us1 undef.c 
> 
> $ nm my-us1 |grep this_symbol
>                  U this_symbol_might_be_undefined
> 
> with ld 2.29, the undefined reference is not emitted, but it is emitted on
> arm, aarch64, powerpc, s390x

With 2.28, I got


address@hidden pr22126]$ cat x.s
        .text
        .globl _start
_start:
        .dc.a this_symbol_might_be_undefined
address@hidden pr22126]$ make
/export/build/gnu/binutils-cross/build-arm-linux-androideabi/gas/as-new   -o
x.o x.s
/export/build/gnu/binutils-cross/build-arm-linux-androideabi/ld/ld-new
--unresolved-symbols=ignore-all -o x x.o
/export/build/gnu/binutils-cross/build-arm-linux-androideabi/binutils/nm-new x
00020058 T __bss_end__
00020058 T _bss_end__
00020058 T __bss_start
00020058 T __bss_start__
00020058 T _edata
00020058 T _end
00020058 T __end__
00010054 T _start
address@hidden pr22126]$ 

The undefined symbol was removed by

ommit d983c8c5503d680c6d4955ceb610a9beebc64460
Author: Alan Modra <address@hidden>
Date:   Wed Feb 18 17:02:39 2015 +1030

    Strip undefined symbols from .symtab

    bfd/
            PR ld/4317
            * elflink.c (elf_link_input_bfd): Drop undefined local syms.
            (elf_link_output_extsym): Drop local and global undefined syms.
            Tidy.  Expand comment.

-- 
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]