diff options
author | Jan Beulich <jbeulich@suse.com> | 2025-03-07 11:23:13 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2025-03-07 11:23:13 +0100 |
commit | 60e254b7012b370f1b55d572565f829379553a7e (patch) | |
tree | b0e2634fd3e15d7c96397fe7b2d915e62b27667c /binutils/testsuite/binutils-all | |
parent | 9385922d3fb9304622bbd78b2437bcfa50e7491a (diff) | |
download | binutils-60e254b7012b370f1b55d572565f829379553a7e.zip binutils-60e254b7012b370f1b55d572565f829379553a7e.tar.gz binutils-60e254b7012b370f1b55d572565f829379553a7e.tar.bz2 |
objdump: properly disassemble successive functions of the same name
... when only their symbol was requested for disassembly. Addressing the
respective FIXME is as easy as coverting the "else" there to an if()
with the opposite condition, thus accounting for the disabling the
original if() may have effected.
Diffstat (limited to 'binutils/testsuite/binutils-all')
-rw-r--r-- | binutils/testsuite/binutils-all/multi-1.d | 23 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/multi-2.d | 23 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/multi1.s | 6 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/multi2.s | 6 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/objdump.exp | 16 |
5 files changed, 74 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/multi-1.d b/binutils/testsuite/binutils-all/multi-1.d new file mode 100644 index 0000000..4cfdc61 --- /dev/null +++ b/binutils/testsuite/binutils-all/multi-1.d @@ -0,0 +1,23 @@ +#name: objdump --disassemble= of consecutive same-name functions (1) +#source: multi1.s +#source: multi2.s +#ld: -r +#objdump: --disassemble=func -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].* + +# HPPA 32-bit ELF "ld -r" leaves .text unmerged. +#?Disassembly of section .*: + +0+[0-3][0-9a-f] <func>: +[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].* +#pass diff --git a/binutils/testsuite/binutils-all/multi-2.d b/binutils/testsuite/binutils-all/multi-2.d new file mode 100644 index 0000000..791aa87 --- /dev/null +++ b/binutils/testsuite/binutils-all/multi-2.d @@ -0,0 +1,23 @@ +#name: objdump --disassemble= of consecutive same-name functions (2) +#source: multi2.s +#source: multi1.s +#ld: -r +#objdump: --disassemble=func2 -wz +# ECOFF disassembly omits local symbols, for whatever reason. +#xfail: "alpha*-*-*ecoff" "alpha*-*-osf*" + +.*: +file format .* + +Disassembly of section .*: + +0+ <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].* + +# HPPA 32-bit ELF "ld -r" leaves .text unmerged. +#?Disassembly of section .*: + +0+[0-3][0-9a-f] <func2>: +[ ]*[0-9a-f]+: [0-9a-f][0-9a-f].* +#pass diff --git a/binutils/testsuite/binutils-all/multi1.s b/binutils/testsuite/binutils-all/multi1.s new file mode 100644 index 0000000..ee7a397 --- /dev/null +++ b/binutils/testsuite/binutils-all/multi1.s @@ -0,0 +1,6 @@ + .text +func: + .nop + +func2: + .nop diff --git a/binutils/testsuite/binutils-all/multi2.s b/binutils/testsuite/binutils-all/multi2.s new file mode 100644 index 0000000..34e52e8 --- /dev/null +++ b/binutils/testsuite/binutils-all/multi2.s @@ -0,0 +1,6 @@ + .text +func2: + .nop + +func: + .nop diff --git a/binutils/testsuite/binutils-all/objdump.exp b/binutils/testsuite/binutils-all/objdump.exp index e74b77b..aa7ddda 100644 --- a/binutils/testsuite/binutils-all/objdump.exp +++ b/binutils/testsuite/binutils-all/objdump.exp @@ -249,6 +249,22 @@ if { [ remote_file host exists $testarchive ] } then { test_objdump_d $testarchive bintest2.${obj} } +# AIX gas doesn't add local symbols to the symbol table. +# TI C30 and C54x ld emits various "address .. of tmpdir/dump section `...' is +# not within region `...'" errors, which look bogus for relocatable linking. +# alpha-vms doesn't support relocatable linking. +# i?86-msdos ld generates an executable despite being passed -r. +# Don't chance other than our own ld improperly handling -r. +if { ![istarget "*-*-aix*"] + && ![istarget "*c30-*-*"] + && ![istarget "*c54x-*-*"] + && ![istarget "alpha-*-*vms*"] + && ![istarget "i?86-*-msdos"] + && [file normalize "$LD"] == [file normalize "$objdir/../ld/ld-new"]} then { + run_dump_test multi-1 + run_dump_test multi-2 +} + # Test objdump --disassemble=<symbol> proc test_objdump_d_sym { testfile dumpfile } { global OBJDUMP |