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

2017-08-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21961

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

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

commit 5b5f4e6f8cd250e07ec98278f7223e57b3d3bb0c
Author: Andrew Burgess 
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.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


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

2017-08-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21961

--- Comment #6 from cvs-commit at gcc dot gnu.org  ---
The binutils-2_29-branch branch has been updated by Andrew Burgess
:

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

commit dbb8f8b80b108dd60ab51c3e482c9c0865408b68
Author: Andrew Burgess 
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.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/22001] -z nocopyreloc doesn't work right

2017-08-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22001

--- Comment #1 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=7073b5b9edc9e06974bd733b7e4b3845d6d6f690

commit 7073b5b9edc9e06974bd733b7e4b3845d6d6f690
Author: H.J. Lu 
Date:   Thu Aug 24 06:34:19 2017 -0700

x86-64: Check relocations with -z nocopyreloc

On x86-64, when -z nocopyreloc is used to build executable, relocations
may overflow at run-time or may not be resolved without PIC.  This patch
checks these conditions and issues an error with suggestion for -fPIC.

bfd/

PR ld/22001
* elf64-x86-64.c (elf_x86_64_relocate_section): Check for
R_X86_64_PC32 relocation run-time overflow and unresolvable
R_X86_64_32S relocation with -z nocopyreloc.

ld/

PR ld/22001
* testsuite/ld-i386/i386.exp: Run -z nocopyreloc tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* ld/testsuite/ld-i386/pr22001-1a.c: New file.
* ld/testsuite/ld-i386/pr22001-1b.c: Likewise.
* ld/testsuite/ld-i386/pr22001-1c.S: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1a.c: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1a.err: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1b.c: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1b.err: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1c.c: Likewise.

-- 
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/22001] -z nocopyreloc doesn't work right

2017-08-24 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22001

H.J. Lu  changed:

   What|Removed |Added

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

--- Comment #2 from H.J. Lu  ---
Fixed for 2.30.

-- 
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/21961] --orphan-handling=error fails in 2.29 because of changed .group handling

2017-08-24 Thread andrew.burgess at embecosm dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21961

--- Comment #7 from Andrew Burgess  ---
I don't have permission to change the status of this bug to closed: fixed, but
for what it's worth I believe that is now the case.  If anyone thinks there are
still issues in this area, leave a comment (and details) and I'll continue to
investigate.

-- 
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 binutils/21994] Hang in process_version_sections with ent.vd_next = 0 and aux.vda_next = 0

2017-08-24 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21994

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-08-25
 CC||amodra at gmail dot com
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
 Ever confirmed|0   |1

-- 
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/21961] --orphan-handling=error fails in 2.29 because of changed .group handling

2017-08-24 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21961

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Alan Modra  ---
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 binutils/21994] Hang in process_version_sections with ent.vd_next = 0 and aux.vda_next = 0

2017-08-24 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21994

--- Comment #1 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=1445030f313d9b251a6a27c8bdf52197520396e2

commit 1445030f313d9b251a6a27c8bdf52197520396e2
Author: Alan Modra 
Date:   Fri Aug 25 11:41:06 2017 +0930

PR21994, readelf looping on verdefs

PR 21994
* readelf.c (process_version_sections ): Check
vd_aux and vda_next for sanity.  Delete "end".  Correct overflow
checks.
(process_version_sections ): Correct overflow
check.  Don't report invalid vna_next on overflow.  Do report
invalid vna_next on size less than aux info.

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