Bug 16643 - ARM: BFD_ASSERT when only ref to a GC'd symbol is in a stripped section
Summary: ARM: BFD_ASSERT when only ref to a GC'd symbol is in a stripped section
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-27 22:49 UTC by Roland McGrath
Modified: 2014-03-06 23:56 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland McGrath 2014-02-27 22:49:02 UTC
This is similar to https://sourceware.org/bugzilla/show_bug.cgi?id=13990, which see.

$ head gc-hidden-strip-{main,unused}.s
==> /usr/local/google/home/mcgrathr/local/gnu/binutils/ld/testsuite/ld-arm/gc-hidden-strip-main.s <==
	.text
	.globl foo
	.type foo, %function
foo:
	bx lr
	.size foo, . - foo

==> /usr/local/google/home/mcgrathr/local/gnu/binutils/ld/testsuite/ld-arm/gc-hidden-strip-unused.s <==
	.section .data.unused_item,"aw",%progbits
	.p2align 2
	.global unused_item
	.hidden	unused_item
	.type unused_item, %object
	.size unused_item, 4
unused_item:
	.word 1

	.section .debug_blah,"",%progbits
$ ./gas/as-new -o gc-hidden-strip-main.o ~/local/gnu/binutils/ld/testsuite/ld-arm/gc-hidden-strip-main.s
$ ./gas/as-new -o gc-hidden-strip-unused.o ~/local/gnu/binutils/ld/testsuite/ld-arm/gc-hidden-strip-unused.s 
$ ./ld/ld-new -shared --strip-all --gc-sections gc-hidden-strip-main.o gc-hidden-strip-unused.o
./ld/ld-new: BFD (GNU Binutils) 2.24.51.20140227 assertion fail ../../../binutils/bfd/elf32-arm.c:12445
$
Comment 1 Sourceware Commits 2014-02-28 04:11:54 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  9850436d9e423d66d67d27135896582b2725782e (commit)
      from  b721f1faaff1d7440b1e7cf5d920edb1d59b67c6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit 9850436d9e423d66d67d27135896582b2725782e
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Feb 28 14:38:27 2014 +1030

    Fix check_relocs/gc_sweep_hook mismatch
    
    	PR ld/16643
    	* elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly
    	the same conditions we called check_relocs.

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog |    6 ++++++
 bfd/elflink.c |    4 +++-
 2 files changed, 9 insertions(+), 1 deletions(-)
Comment 2 Sourceware Commits 2014-03-06 17:53:35 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, binutils-2_24-branch has been updated
       via  7deface59753c3b249ac08d854d471951796343f (commit)
       via  9e6df09eff10812e2b6ea16e43fad99f67bcad06 (commit)
      from  4a8ad3c2446678ac0be02cf47796ddefe52df0aa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

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

commit 7deface59753c3b249ac08d854d471951796343f
Author: Roland McGrath <mcgrathr@google.com>
Date:   Thu Mar 6 09:46:15 2014 -0800

    Apply ld-arm/gc-hidden-1 to all ELF targets, not just *eabi* targets
    
    ld/testsuite/
    	* ld-arm/gc-hidden-1.d: Remove target, add not-target to match
    	other ELF-only tests in this directory.  Loosen regexps so they
    	don't care what the exact addresses are.
    
    (cherry picked from commit c125dbfb8c4c6755e188815de1bb65bcb7f1f159)

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

commit 9e6df09eff10812e2b6ea16e43fad99f67bcad06
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Feb 28 14:38:27 2014 +1030

    Fix check_relocs/gc_sweep_hook mismatch
    
    	PR ld/16643
    	* elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly
    	the same conditions we called check_relocs.
    
    (cherry picked from commit 9850436d9e423d66d67d27135896582b2725782e)

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                     |    6 ++++++
 bfd/elflink.c                     |    4 +++-
 ld/testsuite/ChangeLog            |    6 ++++++
 ld/testsuite/ld-arm/gc-hidden-1.d |   17 +++++++++--------
 4 files changed, 24 insertions(+), 9 deletions(-)
Comment 3 Roland McGrath 2014-03-06 23:56:37 UTC
Fixed on trunk and 2.24.