aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-02-11 08:36:24 +1030
committerAlan Modra <amodra@gmail.com>2023-02-11 16:43:54 +1030
commit0a3137ce4c4b38ee8b26c09824633b827fed4cb1 (patch)
tree37913b106916fe608c5fbfebd109f99dd0e8220c /gas
parent480ddaa9784c652b7c575e17799e0408ac4e5b01 (diff)
downloadgdb-0a3137ce4c4b38ee8b26c09824633b827fed4cb1.zip
gdb-0a3137ce4c4b38ee8b26c09824633b827fed4cb1.tar.gz
gdb-0a3137ce4c4b38ee8b26c09824633b827fed4cb1.tar.bz2
objdump -D of bss sections and -s with -j
There is some inconsistency between the behaviour of objdump -D and objdump -s, both supposedly operating on all sections by default. objdump -s ignores bss sections, while objdump -D dissassembles the zeros. Fix this by making objdump -D ignore bss sections too. Furthermore, "objdump -s -j .bss" doesn't dump .bss as it should, since the user is specifically asking to look at all those zeros. This change does find some tests that used objdump -D with expected output in bss-style sections. I've updated all the msp430 tests that just wanted to find a non-empty section to look at section headers instead, making the tests slightly more stringent. The ppc xcoff and spu tests are fixed by adding -j options to objdump, which makes the tests somewhat more lenient. binutils/ * objdump.c (disassemble_section): Ignore sections without contents, unless overridden by -j. (dump_section): Allow -j to override the default of not displaying sections without contents. * doc/binutils.texi (objdump options): Update -D, -s and -j description. gas/ * testsuite/gas/ppc/xcoff-tls-32.d: Select wanted objdump sections with -j. * testsuite/gas/ppc/xcoff-tls-64.d: Likewise. ld/ * testsuite/ld-msp430-elf/main-bss-lower.d, * testsuite/ld-msp430-elf/main-bss-upper.d, * testsuite/ld-msp430-elf/main-const-lower.d, * testsuite/ld-msp430-elf/main-const-upper.d, * testsuite/ld-msp430-elf/main-text-lower.d, * testsuite/ld-msp430-elf/main-text-upper.d, * testsuite/ld-msp430-elf/main-var-lower.d, * testsuite/ld-msp430-elf/main-var-upper.d: Expect -wh output. * testsuite/ld-msp430-elf/msp430-elf.exp: Use objdump -wh rather than objdump -D or objdump -d with tests checking for non-empty given sections. * testsuite/ld-spu/ear.d, * testsuite/ld-spu/icache1.d, * testsuite/ld-spu/ovl.d, * testsuite/ld-spu/ovl2.d: Select wanted objdump sections.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/gas/ppc/xcoff-tls-32.d2
-rw-r--r--gas/testsuite/gas/ppc/xcoff-tls-64.d2
2 files changed, 2 insertions, 2 deletions
diff --git a/gas/testsuite/gas/ppc/xcoff-tls-32.d b/gas/testsuite/gas/ppc/xcoff-tls-32.d
index eb71df0..c20e01c 100644
--- a/gas/testsuite/gas/ppc/xcoff-tls-32.d
+++ b/gas/testsuite/gas/ppc/xcoff-tls-32.d
@@ -1,6 +1,6 @@
#as: -a32
#source: xcoff-tls.s
-#objdump: -Dr
+#objdump: -Dr -j.data -j.tdata -j.tbss
#name: XCOFF TLS relocation (32 bit)
.*
diff --git a/gas/testsuite/gas/ppc/xcoff-tls-64.d b/gas/testsuite/gas/ppc/xcoff-tls-64.d
index 7f3b6eb..f24f89e 100644
--- a/gas/testsuite/gas/ppc/xcoff-tls-64.d
+++ b/gas/testsuite/gas/ppc/xcoff-tls-64.d
@@ -1,6 +1,6 @@
#as: -a64
#source: xcoff-tls.s
-#objdump: -Dr
+#objdump: -Dr -j.data -j.tdata -j.tbss
#name: XCOFF TLS relocation (64 bit)
.*