bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/22842] Handling of R_X86_64_PC32 in a PIE against a function in


From: hjl.tools at gmail dot com
Subject: [Bug ld/22842] Handling of R_X86_64_PC32 in a PIE against a function in a shared library could be better
Date: Tue, 13 Feb 2018 22:33:29 +0000

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

--- Comment #3 from H.J. Lu <hjl.tools 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:
> 
> $ ./run.sh
> 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 <address@hidden>
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.


reply via email to

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