bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE


From: cvs-commit at gcc dot gnu.org
Subject: [Bug ld/22269] Undefined weak symbols isn't resolved to 0 in static PIE
Date: Wed, 11 Jul 2018 16:43:36 +0000

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

--- Comment #35 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The binutils-2_31-branch branch has been updated by Max Filippov
<address@hidden>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=82f32155837415d3f84ceb9c9ffa36495f7211ae

commit 82f32155837415d3f84ceb9c9ffa36495f7211ae
Author: Max Filippov <address@hidden>
Date:   Mon Jul 2 11:12:44 2018 -0700

    xtensa: don't emit dynamic relocation for weak undefined symbol

    Resolved reference to a weak undefined symbol in PIE must not have
    a dynamic relative relocation against itself, otherwise the value of a
    reference will be changed from 0 to the base of executable, breaking
    code like the following:

      void weak_function (void);
      if (weak_function)
        weak_function ();

    This fixes tests for PR ld/22269 and a number of PIE tests in xtensa gcc
    testsuite.

    bfd/
    2018-07-11  Max Filippov  <address@hidden>

        * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Don't allocate
        space for dynamic relocation for undefined weak symbol.
        (elf_xtensa_relocate_section): Don't emit R_XTENSA_RELATIVE
        relocation for undefined weak symbols.
        (shrink_dynamic_reloc_sections): Don't shrink dynamic relocation
        section for relocations against undefined weak symbols.

    (cherry picked from commit c451bb34ae8bd2d0669bd563366883cfbcf0de9b)

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