mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
d422d1c433
I noticed that _bfd_elf_gc_mark_extra_sections attempts to unmark related debug sections when it finds an unmarked code section. When it finds .text.foo is unmarked, for example, it removes .debug_line.text.foo as well (using the section name as a suffix match check. However, it bails out after finding one such section. bfd/ * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't break on first matching debug section. ld/testsuite/ * ld-gc/all-debug-sections.d: New file. * ld-gc/all-debug-sections.s: Likewise. * ld-gc/gc.exp: Execute new testcase.
57 lines
963 B
ArmAsm
57 lines
963 B
ArmAsm
.section .text.useless,"ax",%progbits
|
|
.globl useless
|
|
.type useless, %function
|
|
useless:
|
|
.long 1
|
|
|
|
.section .text.main,"ax",%progbits
|
|
.globl _start
|
|
_start:
|
|
.globl main
|
|
.type main, %function
|
|
main:
|
|
.long 2
|
|
|
|
.section .text,"ax",%progbits
|
|
.long main
|
|
|
|
.section .debug_info.text.main,"",%progbits
|
|
debug_info_main:
|
|
.long 0x3c
|
|
.long main
|
|
|
|
.section .debug_info.text.useless,"",%progbits
|
|
debug_info_useless:
|
|
.long 0x38
|
|
.long useless
|
|
|
|
.section .debug_info,"",%progbits
|
|
.long 0x49
|
|
|
|
.section .debug_aranges,"",%progbits
|
|
.long 0x3c
|
|
|
|
.section .debug_aranges.text.main,"",%progbits
|
|
debug_aranges_main:
|
|
.long 0x2c
|
|
.long main
|
|
|
|
.section .debug_aranges.text.useless,"",%progbits
|
|
debug_aranges_useless:
|
|
.long 0x2c
|
|
.long useless
|
|
|
|
.section .debug_line,"",%progbits
|
|
.long 0x3c
|
|
|
|
.section .debug_line.text.main,"",%progbits
|
|
debug_line_main:
|
|
.long 0x2c
|
|
.long main
|
|
|
|
.section .debug_line.text.useless,"",%progbits
|
|
debug_line_useless:
|
|
.long 0x2c
|
|
.long useless
|
|
|