This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PR ld/16643: ARM: BFD_ASSERT when only ref to a GC'd symbol is in a stripped section
- From: Roland McGrath <mcgrathr at google dot com>
- To: Roland McGrath <mcgrathr at google dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 28 Feb 2014 09:44:03 -0800
- Subject: Re: PR ld/16643: ARM: BFD_ASSERT when only ref to a GC'd symbol is in a stripped section
- Authentication-results: sourceware.org; auth=none
- References: <CAB=4xho=rub8PTp2WO-+YKu9jUhg0Gb735rA5F-_+-XSUxnSUQ at mail dot gmail dot com> <20140228002516 dot GE14922 at bubble dot grove dot modra dot org>
On Thu, Feb 27, 2014 at 4:25 PM, Alan Modra <amodra@gmail.com> wrote:
> Here you go, this cures your testcase.
Great! Thanks a lot.
OK to commit the test case now?
OK to backport both fix and test to 2.24?
Thanks,
Roland
ld/testsuite/
2014-02-28 Roland McGrath <mcgrathr@google.com>
PR ld/16643
* ld-arm/gc-hidden-strip.d: New file.
* ld-arm/gc-hidden-strip-unused.s: New file.
* ld-arm/gc-hidden-strip-main.s: New file.
* ld-arm/arm-elf.exp: Run the new test.
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -842,3 +842,4 @@ if { ![istarget "arm*-*-nacl*"] } {
}
run_dump_test "unresolved-2"
run_dump_test "gc-hidden-1"
+run_dump_test "gc-hidden-strip"
--- /dev/null
+++ b/ld/testsuite/ld-arm/gc-hidden-strip-main.s
@@ -0,0 +1,6 @@
+ .text
+ .globl foo
+ .type foo, %function
+foo:
+ bx lr
+ .size foo, . - foo
--- /dev/null
+++ b/ld/testsuite/ld-arm/gc-hidden-strip-unused.s
@@ -0,0 +1,11 @@
+ .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
+ .word unused_item
--- /dev/null
+++ b/ld/testsuite/ld-arm/gc-hidden-strip.d
@@ -0,0 +1,15 @@
+#source: gc-hidden-strip-main.s
+#source: gc-hidden-strip-unused.s
+#ld: --gc-sections --shared --strip-all
+#objdump: -RT
+# This test is only valid on ELF based ports.
+# not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+
+# See PR ld/16643: the only reference to a GC'd symbol is in a stripped
+# section, trigging a BFD_ASSERT.
+
+.*: file format elf32-.*
+
+DYNAMIC SYMBOL TABLE:
+0+[0-9a-f]+ l\s+d\s+\.text\s+0+\s+\.text
+#pass