aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-01-08 01:43:23 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-01-08 01:43:23 +0000
commitbde6f3eb6dff94cea1d471e15c6154d55d49820f (patch)
tree33ff2b586001fc671d83306de7968fdaab523c67 /ld
parentb903363e43c8ea7d9b37b599bc15591036d03690 (diff)
downloadfsf-binutils-gdb-bde6f3eb6dff94cea1d471e15c6154d55d49820f.zip
fsf-binutils-gdb-bde6f3eb6dff94cea1d471e15c6154d55d49820f.tar.gz
fsf-binutils-gdb-bde6f3eb6dff94cea1d471e15c6154d55d49820f.tar.bz2
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. ld/testsuite/ 2010-01-07 H.J. Lu <hongjiu.lu@intel.com> PR ld/11133 * ld-gc/gc.exp: Run start. * ld-gc/start.d: New. * ld-gc/start.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-gc/gc.exp1
-rw-r--r--ld/testsuite/ld-gc/start.d8
-rw-r--r--ld/testsuite/ld-gc/start.s6
4 files changed, 23 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 3320c13..220a6d9 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,13 @@
2010-01-07 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/11133
+ * ld-gc/gc.exp: Run start.
+
+ * ld-gc/start.d: New.
+ * ld-gc/start.s: Likewise.
+
+2010-01-07 H.J. Lu <hongjiu.lu@intel.com>
+
PR ld/11143
* ld-gc/gc.exp: Run abi-note.
diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
index 36df233..c271a3d 100644
--- a/ld/testsuite/ld-gc/gc.exp
+++ b/ld/testsuite/ld-gc/gc.exp
@@ -91,3 +91,4 @@ test_gc "Check --gc-section/-r/-u" "gcrel" $ld "-r --gc-sections -u used_func"
run_dump_test "noent"
run_dump_test "abi-note"
+run_dump_test "start"
diff --git a/ld/testsuite/ld-gc/start.d b/ld/testsuite/ld-gc/start.d
new file mode 100644
index 0000000..a6f748f
--- /dev/null
+++ b/ld/testsuite/ld-gc/start.d
@@ -0,0 +1,8 @@
+#name: --gc-sections with __start_
+#ld: --gc-sections -e _start
+#nm: -n
+#target: *-*-linux*
+
+#...
+[0-9a-f]+ A +__start__foo
+#...
diff --git a/ld/testsuite/ld-gc/start.s b/ld/testsuite/ld-gc/start.s
new file mode 100644
index 0000000..d9f1b2d
--- /dev/null
+++ b/ld/testsuite/ld-gc/start.s
@@ -0,0 +1,6 @@
+.globl _start
+_start:
+ .long __start__foo
+ .section _foo,"aw",%progbits
+foo:
+ .long 1