aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-gc/pr19161.d
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-10-22 12:17:43 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-10-22 12:23:03 -0700
commitbba037e0aef1f3b17cc6cf6fd041ed6110cc375a (patch)
tree6f2fad132412629daaf56228009b62eb7c9e4914 /ld/testsuite/ld-gc/pr19161.d
parentd236ad1955a0a6b5203bc1474b989fd9dba668f8 (diff)
downloadgdb-bba037e0aef1f3b17cc6cf6fd041ed6110cc375a.zip
gdb-bba037e0aef1f3b17cc6cf6fd041ed6110cc375a.tar.gz
gdb-bba037e0aef1f3b17cc6cf6fd041ed6110cc375a.tar.bz2
Always keep sections marked with SEC_KEEP
SEC_KEEP check in elf_gc_sweep was missing in commit: commit bde6f3eb6dff94cea1d471e15c6154d55d49820f Author: H.J. Lu <hjl.tools@gmail.com> Date: Fri Jan 8 01:43:23 2010 +0000 Set SEC_KEEP on section XXX for undefined __start_XXX/__stop_XXX bfd/ 2010-01-07 H.J. Lu <hongjiu.lu@intel.com> PR ld/11133 * elflink.c (_bfd_elf_gc_mark_hook): Check section XXX for undefined __start_XXX/__stop_XXX in all input files and set SEC_KEEP. This patch adds SEC_KEEP check to elf_gc_sweep. bfd/ PR ld/19161 * elflink.c (elf_gc_sweep): Always keep sections marked with SEC_KEEP. ld/testsuite/ PR ld/19161 * ld-gc/gc.exp: Run pr19161 test. * ld-gc/pr19161-1.c: New file. * ld-gc/pr19161-2.c: Likewise. * ld-gc/pr19161.d: Likewise.
Diffstat (limited to 'ld/testsuite/ld-gc/pr19161.d')
-rw-r--r--ld/testsuite/ld-gc/pr19161.d9
1 files changed, 9 insertions, 0 deletions
diff --git a/ld/testsuite/ld-gc/pr19161.d b/ld/testsuite/ld-gc/pr19161.d
new file mode 100644
index 0000000..64b17e0
--- /dev/null
+++ b/ld/testsuite/ld-gc/pr19161.d
@@ -0,0 +1,9 @@
+#name: --gc-sections with __start_SECTIONNAME
+#source: dummy.s
+#ld: --gc-sections -e main tmpdir/pr19161-1.o tmpdir/pr19161-2.o
+#nm: --format=bsd
+#xfail: sh64*-*-* iq2000-*-* lm32-*-* epiphany-*-* mips64vr-*-* frv-*-* m32c-*-* rl78-*-* rx-*-* sh-*-* powerpc*-*-eabivle msp430-*-*
+
+#...
+0*[1-9a-f]+[0-9a-f]*[ ](D)[ ]_*__start_my_section
+#...