Add --gc-sections test checking removal of __start/__stop symbols.

Well, just __stop__foo but that should be good enough.

	* testsuite/ld-gc/stop.d,
	* testsuite/ld-gc/stop.s: New test.
	* testsuite/ld-gc/gc.exp: Run it.
This commit is contained in:
Alan Modra 2018-01-30 22:11:00 +10:30
parent 76cb3a89a6
commit 040b4a9eb8
4 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2018-01-30 Alan Modra <amodra@gmail.com>
* testsuite/ld-gc/stop.d,
* testsuite/ld-gc/stop.s: New test.
* testsuite/ld-gc/gc.exp: Run it.
2018-01-30 Maciej W. Rozycki <macro@mips.com> 2018-01-30 Maciej W. Rozycki <macro@mips.com>
PR ld/22649 PR ld/22649

View File

@ -104,6 +104,7 @@ test_gc "Check --gc-section/-r/-u" "gcrel" $ld "-r --gc-sections -u used_func"
run_dump_test "noent" run_dump_test "noent"
run_dump_test "abi-note" run_dump_test "abi-note"
run_dump_test "start" run_dump_test "start"
run_dump_test "stop"
run_dump_test "pr19167" run_dump_test "pr19167"
if { [is_elf_format] } then { if { [is_elf_format] } then {
run_dump_test "all-debug-sections" run_dump_test "all-debug-sections"

10
ld/testsuite/ld-gc/stop.d Normal file
View File

@ -0,0 +1,10 @@
#name: --gc-sections removing __stop_
#ld: --gc-sections -e _start
#nm: -n
#target: *-*-linux* *-*-gnu*
#notarget: *-*-*aout *-*-*oldld frv-*-linux* metag-*-linux*
#failif
#...
[0-9a-f]+ D +__stop__foo
#...

View File

@ -0,0 +1,8 @@
.text
.globl _start
_start:
.dc.a 0
.section _foo,"aw",%progbits
foo:
.long 1