[Top][All Lists]

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

[Bug ld/22649] -gc-sections preserves hidden symbols that are also visib

From: cvs-commit at gcc dot gnu.org
Subject: [Bug ld/22649] -gc-sections preserves hidden symbols that are also visible in dynamic objects
Date: Tue, 30 Jan 2018 01:36:44 +0000


--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Maciej W. Rozycki <address@hidden>:


commit af667f2218ecf772ac2f8882ceba6a16ddc18ddc
Author: Maciej W. Rozycki <address@hidden>
Date:   Tue Jan 30 01:31:23 2018 +0000

    MIPS/LD/testsuite: Correct PR ld/22649 test case failures

    Fix commit d664fd41e15f ("Ignore dynamic references on forced local
    symbols") and use alternative test actions and match patterns to
    correctly handle messages like:

    .../ld/ld-new: Removing unused section '.reginfo' in file


    .../ld/ld-new: Removing unused section '.MIPS.options' in file

    produced by LD on MIPS targets, removing:

    FAIL: Build pr22649-2c.so
    FAIL: Build pr22649-2d.so

    test suite failures and tightening checks made with `pr22649-2a.so' and
    `pr22649-2b.so' test cases.

    Keep the original empty action with `pr22649-2c.so' and `pr22649-2d.so'
    links and MIPS/ELF targets though, because for them the linker does not
    garbage-collect the `.reginfo' section.  This is because the section has
    its flags set differently by code in GAS in `md_begin':

        if (strncmp (TARGET_OS, "elf", 3) != 0)
          flags |= SEC_ALLOC | SEC_LOAD;

    and consequently BFD linker code in `_bfd_elf_gc_mark_extra_sections':

          else if (((isec->flags & SEC_DEBUGGING) != 0
                    || (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
                   && elf_next_in_group (isec) == NULL)
            isec->gc_mark = 1;

    marks these sections to be kept due to their SEC_ALLOC, SEC_LOAD and
    SEC_RELOC flags all being zero (`.reginfo' sections never have
    relocations attached).

        PR ld/22649
        * testsuite/ld-elf/pr22649-2ab-mips.msg: New stderr output.
        * testsuite/ld-elf/pr22649-2cd-mips.msg: New stderr output.
        * testsuite/ld-elf/shared.exp: Use the new outputs with
        `mips*-*-*' targets.

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]