bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/21382] --as-needed cannot be combined with -flto


From: cvs-commit at gcc dot gnu.org
Subject: [Bug ld/21382] --as-needed cannot be combined with -flto
Date: Thu, 20 Apr 2017 14:49:24 +0000

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by H.J. Lu <address@hidden>:

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

commit 59fa66c53823dc695f78669f40ec2eebab3aec42
Author: H.J. Lu <address@hidden>
Date:   Thu Apr 20 07:48:24 2017 -0700

    Handle symbol defined in IR and referenced in DSO

    We need to make an IR symbol visible if it is defined in an IR object
    and referenced in a dynamic object.  When --as-needed is used, since
    linker removes the IR symbol reference of the dynamic object if the
    dynamic object isn't needed in the first pass, the IR definition isn't
    visible to the dynamic object even if the dynamic object becomes needed
    in the second pass.  Add dynamic_ref_after_ir_def to bfd_link_hash_entry
    to track IR symbol which is defined in an IR object and later referenced
    in a dynamic object.  dynamic_ref_after_ir_def is preserved when restoring
    the symbol table for unneeded dynamic object.

    bfd/

        PR ld/21382
        * elflink.c (elf_link_add_object_symbols): Preserve
        dynamic_ref_after_ir_def when restoring the symbol table for
        unneeded dynamic object.

    include/

        PR ld/21382
        * bfdlink.h (bfd_link_hash_entry): Add dynamic_ref_after_ir_def.

    ld/

        PR ld/21382
        * plugin.c (is_visible_from_outside): Symbol may be visible
        from outside if dynamic_ref_after_ir_def is set.
        (plugin_notice): Set dynamic_ref_after_ir_def if the symbol is
        defined in an IR object and referenced in a dynamic object.
        * testsuite/ld-plugin/lto.exp: Run PR ld/21382 tests.
        * testsuite/ld-plugin/pr21382a.c: New file.
        * testsuite/ld-plugin/pr21382b.c: Likewise.

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