bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/21961] --orphan-handling=error fails in 2.29 because of changed


From: cvs-commit at gcc dot gnu.org
Subject: [Bug ld/21961] --orphan-handling=error fails in 2.29 because of changed .group handling
Date: Thu, 24 Aug 2017 11:43:20 +0000

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

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

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

commit 5b5f4e6f8cd250e07ec98278f7223e57b3d3bb0c
Author: Andrew Burgess <address@hidden>
Date:   Thu Aug 17 11:29:04 2017 +0100

    ld: Early detection of orphans we know will be discarded

    When processing an orphan section we first call lang_place_orphans, this
    function handles a few sections for which the behaviour is known COMMON
    sections, or sections marked as SEC_EXCLUDE.

    Any orphans that are not handled in lang_place_orphans are passed on to
    ldlang_place_orphan, this is where we decide where to put the orphan,
    and then call lang_add_section to perform the actual orphan placement.

    We previously had a larger set of checks at the start of the function
    lang_add_section to discard some sections that we _knew_ should not be
    added into the output file, this was where .group sections (in a final
    link) and .debug* sections (with --strip-debug) were dropped.

    The problem with dropping these sections at the lang_add_section stage
    is that a user might also be using --orphan-handling=error to prevent
    orphans.  If they are then they should not be get errors about sections
    that we know will be discarded, and which are not mentioned in the
    linker script.

    The solution proposed in this patch is to move the "will this section be
    discarded" check into a separate function, and use this in
    lang_place_orphans to have the early discard phase discard sections that
    we know should not be included in the output file.

    ld/ChangeLog:

        PR 21961
        * ldlang.c (lang_discard_section_p): New function.
        (lang_add_section): Checks moved out into new function, which is
        now called.
        (lang_place_orphans): Call lang_discard_section_p instead of
        duplicating some of the checks from lang_add_section.
        * testsuite/ld-elf/orphan-11.d: New file.
        * testsuite/ld-elf/orphan-11.ld: New file.
        * testsuite/ld-elf/orphan-11.s: New file.
        * testsuite/ld-elf/orphan-12.d: New file.
        * testsuite/ld-elf/orphan-12.s: New file.

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