mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-12 12:16:04 +08:00
5789f845fb
The testcases added here show situations where synthesized start/stop symbols don't cause their associated input sections to be marked. Fixed with the elflink.c and ldlang.c changes. bfd/ PR 27500 * elflink.c (_bfd_elf_gc_mark_rsec): Do special start/stop processing not when start/stop symbol section is unmarked but on first time a start/stop symbol is processed. ld/ * ldlang.c (insert_undefined): Don't mark symbols here. (lang_mark_undefineds): Do so here instead, new function. (lang_process): Call lang_mark_undefineds. * testsuite/ld-gc/start3.d, * testsuite/ld-gc/start3.s: New test. * testsuite/ld-gc/start4.d, * testsuite/ld-gc/start4.s: New test. * testsuite/ld-gc/gc.exp: Run them.
20 lines
279 B
ArmAsm
20 lines
279 B
ArmAsm
.text
|
|
.global _start
|
|
_start:
|
|
.dc.a foo_xx
|
|
.ifdef UNDERSCORE
|
|
.dc.a ___start_xx, ___stop_xx
|
|
.else
|
|
.dc.a __start_xx, __stop_xx
|
|
.endif
|
|
|
|
.section xx,"a",%progbits,unique,0
|
|
.global foo_xx
|
|
foo_xx:
|
|
.dc.a 1
|
|
|
|
.section xx,"a",%progbits,unique,1
|
|
.global bar_xx
|
|
bar_xx:
|
|
.dc.a 3
|