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: Thu, 12 Oct 2017 04:09:19 +0000

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

--- Comment #14 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Alan Modra <address@hidden>:

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

commit 22b1ee183d19a92cc57859c04307d31c06792d13
Author: Alan Modra <address@hidden>
Date:   Thu Oct 12 13:19:10 2017 +1030

    Set dynamic_undefined_weak to zero for static PIEs

    I believe we should be warning if ld is given both --no-dynamic-linker
    and -z dynamic-undefined-weak.  The two options are contradictory, the
    first says an executable has no dynamic interpreter to resolve dynamic
    symbols, while the second is asking for dynamic symbols to be emitted.
    (And even if a static PIE's relocation code, which is needed to
    process R_*_RELATIVE relocs, could process symbols, there are no
    DT_NEEDED dynamic objects to define such symbols.)

    I also think that dynamic_undefined_weak is the right flag to control
    whether undefined weaks are made dynamic, whether in static PIEs or
    anywhere else.  So force it to 0 for static PIEs, fixing PR 22269 for
    powerpc and any other target where the backend usually defaults to
    undefined weaks being made dynamic.

    This patch introduces regressions.  I'd normally not do that, but
    these are all in very recently added test cases, or expose bugs in the
    x86 backend.  The test cases were added after I'd made it known that
    this patch or one like it was imminent.

        PR 22269
        * emultempl/elf32.em (after_parse): Warn on --no-dynamic-linker
        -z dynamic-undefined-weak combination.  Set dynamic_undefined_weak
        to zero when nointerp.

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