objdump: permit disassembling multiple individual functions

Compilers may split functions, e.g. into a "hot" and "cold" part, or
they may emit special case instantiations (e.g. as a result of IPA). It
can be helpful to be able to disassemble all of the parts or clones in
one go. Permit using "--disassemble=" multiple times.
This commit is contained in:
Jan Beulich
2025-03-07 11:24:19 +01:00
parent 60e254b701
commit cdd8492b05
4 changed files with 63 additions and 14 deletions

View File

@@ -0,0 +1,28 @@
#name: objdump multiple --disassemble=
#source: multi1.s
#source: multi2.s
#ld: -r
#objdump: --disassemble=func --disassemble=func2 -wz
# ECOFF disassembly omits local symbols, for whatever reason.
#xfail: "alpha*-*-*ecoff" "alpha*-*-osf*"
.*: +file format .*
Disassembly of section .*:
0+ <func>:
[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
#?[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
#?[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
0+[0-1][0-9a-f] <func2>:
[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
#...
0+[0-2][0-9a-f] <func2>:
[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
#?[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
#?[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
0+[0-3][0-9a-f] <func>:
[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].*
#pass

View File

@@ -263,6 +263,7 @@ if { ![istarget "*-*-aix*"]
&& [file normalize "$LD"] == [file normalize "$objdir/../ld/ld-new"]} then {
run_dump_test multi-1
run_dump_test multi-2
run_dump_test multi-3
}
# Test objdump --disassemble=<symbol>