[Bug ld/22649] -gc-sections preserves hidden symbols that are also visible in dynamic objects

2018-03-31 Thread jeremip11 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22649

Jeremi  changed:

   What|Removed |Added

 CC||jeremip11 at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22649] -gc-sections preserves hidden symbols that are also visible in dynamic objects

2018-01-29 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22649

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

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

commit af667f2218ecf772ac2f8882ceba6a16ddc18ddc
Author: Maciej W. Rozycki 
Date:   Tue Jan 30 01:31:23 2018 +

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
'tmpdir/pr22649-2b.o'

or:

.../ld/ld-new: Removing unused section '.MIPS.options' in file
'tmpdir/pr22649-2b.o'

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).

ld/
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.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22649] -gc-sections preserves hidden symbols that are also visible in dynamic objects

2018-01-12 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22649

--- Comment #3 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

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

commit 87e79a6515951fece72ee08871dd6e112b1042ba
Author: Alan Modra 
Date:   Fri Jan 12 16:58:04 2018 +1030

Fixes for "Ignore dynamic references on forced local symbols"

PowerPC64 has its own mark_dynamic_ref, which needs the same change as
made by d664fd41e1 to the generic ELF version.  Some other targets
discard more than just .data, so allow for that too in expected ld
messages.

bfd/
PR ld/22649
* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
references on forced local symbols.
ld/
PR ld/22649
* testsuite/ld-elf/pr22649.msg: Allow other messages.
* testsuite/ld-elf/shared.exp: Check that --gc-sections is
supported before running ld/22649 tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22649] -gc-sections preserves hidden symbols that are also visible in dynamic objects

2018-01-11 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22649

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit d664fd41e15f058aab41b70c567ad09f2fab1115
Author: H.J. Lu 
Date:   Thu Jan 11 15:36:40 2018 -0800

Ignore dynamic references on forced local symbols

We should ignore dynamic references on forced local symbols during
garbage collection since they can never be referenced dynamically.

bfd/

PR ld/22649
* elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
references on forced local symbols.

ld/

PR ld/22649
* testsuite/ld-elf/pr22649-1.s: New file.
* testsuite/ld-elf/pr22649-2a.s: Likewise.
* testsuite/ld-elf/pr22649-2b.s: Likewise.
* testsuite/ld-elf/pr22649.msg: Likewise.
* testsuite/ld-elf/shared.exp: Run ld/22649 tests.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22649] -gc-sections preserves hidden symbols that are also visible in dynamic objects

2018-01-11 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22649

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.30

--- Comment #1 from H.J. Lu  ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22649] -gc-sections preserves hidden symbols that are also visible in dynamic objects

2017-12-29 Thread vlad at ispras dot ru
https://sourceware.org/bugzilla/show_bug.cgi?id=22649

Vladislav Ivanishin  changed:

   What|Removed |Added

 CC||vlad at ispras dot ru

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils