diff options
author | Nick Clifton <nickc@redhat.com> | 2023-08-01 14:37:04 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-12-20 02:37:37 +0000 |
commit | 83d5e7b750556c9c7389a888bf1e3bfc33622b58 (patch) | |
tree | 9c61262b0c475b216ce61d62f7ad675c0145b40b | |
parent | 1ce656c66f1859d0f6066e0f9064033712e37aea (diff) | |
download | fsf-binutils-gdb-83d5e7b750556c9c7389a888bf1e3bfc33622b58.zip fsf-binutils-gdb-83d5e7b750556c9c7389a888bf1e3bfc33622b58.tar.gz fsf-binutils-gdb-83d5e7b750556c9c7389a888bf1e3bfc33622b58.tar.bz2 |
Fix "--only-keep-debug for ELF relocatables" binutils test for compilers which add .debug_macro sections to object files.
PR 30699
* binutils/testsuite/binutils-all/objcopy.exp (keep_debug_symbols_for_elf_relocatable): Do not add sections containing the string "debug_" to the list of non-debug sections.
(cherry picked from commit b99a9693430a9f04165b1b868f890b622bb1b46c)
-rw-r--r-- | binutils/testsuite/binutils-all/objcopy.exp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 1145835..41070c3 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1028,7 +1028,11 @@ proc keep_debug_symbols_for_elf_relocatable { prog flags test } { {[^a-zA-Z]+([a-zA-Z0-9_\.]+)[ \t]+([A-Z]+)[ \t]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ [0-9]+[ \t]+([A-Z]*)[ \t]+[0-9]+(.*)} \ $got all name type flag rest] } { if { $type != "NOTE" && [regexp {[AG]} $flag] } { - lappend non_debug_sections $name + # PR 30699: Some debug sections can be in a group, so + # exclude sections whose name includes "debug_" + if { ! [regexp {debug_} $name] } { + lappend non_debug_sections $name + } } set got $rest } @@ -1086,6 +1090,7 @@ switch [copy_setup] { untested $test5 if [is_elf_format] { untested $test6 + untested $test7 } } "3" { |