aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-12-05 13:09:12 +0100
committerMartin Liska <mliska@suse.cz>2022-12-05 15:52:51 +0100
commit76a2bcc6b8b07ddfd5093773c4b5fd8e54752fbc (patch)
tree39973b293fb78c4ebcbb5a5fcc03d82befd9e1c8 /binutils
parentadc48a49264637719620b4d52224774cdc4607c8 (diff)
downloadfsf-binutils-gdb-76a2bcc6b8b07ddfd5093773c4b5fd8e54752fbc.zip
fsf-binutils-gdb-76a2bcc6b8b07ddfd5093773c4b5fd8e54752fbc.tar.gz
fsf-binutils-gdb-76a2bcc6b8b07ddfd5093773c4b5fd8e54752fbc.tar.bz2
testsuite: support mold linker
Mold linker demotes symbols like main to be local and the patch adjusts expected output from nm. Moreover, simplify the regex patterns.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/testsuite/binutils-all/addr2line.exp4
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp6
2 files changed, 4 insertions, 6 deletions
diff --git a/binutils/testsuite/binutils-all/addr2line.exp b/binutils/testsuite/binutils-all/addr2line.exp
index 66a2d5d..957ae55 100644
--- a/binutils/testsuite/binutils-all/addr2line.exp
+++ b/binutils/testsuite/binutils-all/addr2line.exp
@@ -34,7 +34,7 @@ if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog executable debug
#testcase for default option.
#Run nm command and input the main symbol address to addr2line.
set output [binutils_run $NM "$opts tmpdir/testprog$exe"]
-if ![regexp -line "^(\[0-9a-fA-F\]+)? +T ${dot}main" $output contents] then {
+if ![regexp -line "^(\[0-9a-fA-F\]+)? +\[Tt\] ${dot}main" $output contents] then {
fail "$testname"
} else {
set list [regexp -inline -all -- {\S+} $contents]
@@ -49,7 +49,7 @@ if ![regexp -line "^(\[0-9a-fA-F\]+)? +T ${dot}main" $output contents] then {
#testcase for -f option.
#Run nm command and input the fn function symbol address to addr2line.
-if ![regexp -line "^(\[0-9a-fA-F\]+)? +T ${dot}fn" $output contents] then {
+if ![regexp -line "^(\[0-9a-fA-F\]+)? +\[Tt\] ${dot}fn" $output contents] then {
fail "$testname -f option"
} else {
set list [regexp -inline -all -- {\S+} $contents]
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index de6f3aa..e338859 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -652,8 +652,7 @@ proc strip_test_with_saving_a_symbol { } {
set exec_output [binutils_run $NM "$NMFLAGS $objfile"]
set exec_output [prune_warnings $exec_output]
- if {![regexp {^([0-9a-fA-F]+)?[ ]+[TD] main} $exec_output] \
- && ![regexp {^([0-9a-fA-F]+)?[ ]+T _main} $exec_output]} {
+ if {![regexp {^([0-9a-fA-F]+)?[ ]+[TtDd] _?main} $exec_output]} {
fail $test
return
}
@@ -902,8 +901,7 @@ proc strip_executable_with_saving_a_symbol { prog flags test1 test2 } {
regsub "^\[0-9a-fA-F\]+\[ \]+T Main\[\n\r\]+" $exec_output "" exec_output
}
- if {![regexp {^([0-9a-fA-F]+)?[ ]+[TD] main} $exec_output] \
- && ![regexp {^([0-9a-fA-F]+)?[ ]+[TD] _main} $exec_output]} {
+ if {![regexp {^([0-9a-fA-F]+)?[ ]+[TtDd] _?main} $exec_output]} {
fail $test1
return
}