--- Comment #3 from H.J. Lu < at gmail dot com> ---
(In reply to Rafael Ávila de Espíndola from comment #2)
> (In reply to H.J. Lu from comment #1)
> > Created attachment 10816 [details]
> > A patch
> > 
> > Please try this.
> The runtime warning is gone, but I still get two different values for the
> address:
> $ ./
> 0x55d0082e2580 0x7f00497992d0
> The symbol foo is also just a plain undefined:
> 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND foo

Fixed on master branch by

commit 1031c264fd23641111df1e12a35d0a8f7e82fb80
Author: H.J. Lu <>
Date:   Tue Feb 13 14:31:53 2018 -0800

    x86: Properly check building shared library

    If a symbol is not defined in a regular file, and we are not generating
    a shared library, then set the symbol to its location in the .plt.  This
    is required to make function pointers compare as equal between the normal
    executable and the shared library.

            * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
            instead of bfd_link_pic, for building shared library.

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

Reply via email to