From patchwork Sat Feb 11 06:13:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 55699 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1356936wrn; Fri, 10 Feb 2023 22:13:46 -0800 (PST) X-Google-Smtp-Source: AK7set8Je9x1zwsRhLh6bEy+jj1gGO0Ws5hCiaMK9XmoEf057y5QHXGWkhJJjWiv+bpxcqZLuvPs X-Received: by 2002:a17:907:9844:b0:888:9693:fb18 with SMTP id jj4-20020a170907984400b008889693fb18mr19351365ejc.37.1676096026186; Fri, 10 Feb 2023 22:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676096026; cv=none; d=google.com; s=arc-20160816; b=c5Vop21UVvnJkUuW/u8kaQ9Dmf0myEWkqTgw1RbCJ82zw0pFFY+PAaFHbdyHGiEZsJ mqHHMOWBw29zUJIF35smrgKD3mzBK9rP5hVqNt5QJCpmGA+AaxuvYjRrv0dHWWqzKLnP 2D8S5ceG0KZLP3ebjH3AQsSxg29/mp2OPZWg9/YcgaOz1KaLBF/Hn4M/RcPKClrSqrAO idSpbYlSijPy1vbjN8FoymJ/VPyd5xCYykUWTHFB73wjReOLgZq55amn/Nj9RxoO8Q/e wTMSyYNjyKYtubZqYGpcIjkYKfgJMNBwJUfMNj548EwYk9k+st1tZTcPODEU+qfXvxzQ 60FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=t71HIcPR3kF3jZPLX4U0jCEu7UfRWI1m2fErrRiyzqo=; b=YaBp4P73gf0tyVe1Ejgygz9wwZM3bVaN6GfWZ9MmPVPwaYMfYZYpEUfQASjgC9K8wE RNFEEzBlqmfWoF5xkAF6sfMUrOo6D6l5zsiA15at2/P+i0d9McB07GIuQhzyEe3nBP16 CmruhBe+GRb1D2d1JeKNfJrzcQ8RmjVqIuj1K2RHadSNkC2NDfPkXwEH8TwDgSV5zP1Z RkOEbX2lCY/4Wn6mNwld+oAaL6Gd7cDVouL6QGozwioQPHug1ewgBFWOgfa+kisy4j2E rMvS4LfAvRjkXLr9yrJ1k5k5Mezg0FCzX9dx1OYXnZehsvrhtWexGhDgiotG51JRXMYT RlnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=SwJgu+mS; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id vs16-20020a170907139000b0088adcfbd9basi6192250ejb.988.2023.02.10.22.13.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 22:13:46 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=SwJgu+mS; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC41A3857C71 for ; Sat, 11 Feb 2023 06:13:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC41A3857C71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676096024; bh=t71HIcPR3kF3jZPLX4U0jCEu7UfRWI1m2fErrRiyzqo=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=SwJgu+mSoDDVLamvyl7HSR8nn9w5PAS3nTLg9YVnoA5uTJYi7+V4qC7BKMhutM0w5 0tWcHsXefQElORkJ/dv0xBemMdkwz37IvwuBQrSFxqpD/Eu8hpZhWcAT6DffM5YpZa VsxOhLn1OrP66gmXYvscPQQaSRLYJPbDKAmNhl8A= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 3C3993858D32 for ; Sat, 11 Feb 2023 06:13:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C3993858D32 Received: by mail-pl1-x62b.google.com with SMTP id d8so7597599plr.10 for ; Fri, 10 Feb 2023 22:13:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t71HIcPR3kF3jZPLX4U0jCEu7UfRWI1m2fErrRiyzqo=; b=jrBACSCLhjuGFo4mcYOSF7o5dD1Xln7DbmvQTed55QGmSYITlUdV9VL0reWb+Ko/40 gZKqcEfEzVpdmZ6hstWfW04OT/htEYBWMI3QZeNqXwyT0PRp9uLlQNJYPwt0y+GehUtK nn4aTzuiJagyTLwVVF4Jp4XoSzDHzYbvMvcb7Wtoo7wJKShp80wAgj/sIk3RnugNwDlN EtWZC2lXHKugCW1y2L93ProJqJXwgEPKeITkKFdHBdH0AQbheh1NKBwnKZAhxrACcZbN uTGcAFQJ2dnzl9QKi2+MGnbRulcgMrofn7T8qyoTLp4S+Rh0hvlEXS16LDdzsZB/krjv FBLg== X-Gm-Message-State: AO0yUKWKY7g0CorAjphNhqhMyOjTvlEwgDSIBr40OxmW3pnYJy+jbnr5 YLw3abvspLr/MwC8YN5EagvcuSwgLXo= X-Received: by 2002:a17:903:32d0:b0:19a:7439:3ea6 with SMTP id i16-20020a17090332d000b0019a74393ea6mr4080415plr.15.1676096012311; Fri, 10 Feb 2023 22:13:32 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id iy12-20020a170903130c00b0019601b73e33sm4279480plb.30.2023.02.10.22.13.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 22:13:32 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id CB5041142D27; Sat, 11 Feb 2023 16:43:29 +1030 (ACDT) Date: Sat, 11 Feb 2023 16:43:29 +1030 To: binutils@sourceware.org Subject: objdump -D of bss sections and -s with -j Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757514067150531001?= X-GMAIL-MSGID: =?utf-8?q?1757514067150531001?= 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. diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 514f8af6438..b1982a95704 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -2407,8 +2407,9 @@ used when disassembling. @item -D @itemx --disassemble-all -Like @option{-d}, but disassemble the contents of all sections, not just -those expected to contain instructions. +Like @option{-d}, but disassemble the contents of all non-empty +non-bss sections, not just those expected to contain instructions. +@option{-j} may be used to select specific sections. This option also has a subtle effect on the disassembly of instructions in code sections. When option @option{-d} is in effect @@ -2502,7 +2503,8 @@ for specification with @option{-b} or @option{-m}. @item -j @var{name} @itemx --section=@var{name} @cindex section information -Display information only for section @var{name}. +Display information for section @var{name}. This option may be +specified multiple times. @item -L @itemx --process-links @@ -2775,8 +2777,9 @@ disassembly. @itemx --full-contents @cindex sections, full contents @cindex object file sections -Display the full contents of any sections requested. By default all -non-empty sections are displayed. +Display the full contents of sections, often used in combination with +@option{-j} to request specific sections. By default all non-empty +non-bss sections are displayed. @item -S @itemx --source diff --git a/binutils/objdump.c b/binutils/objdump.c index 4292c23a9ab..9dd1ebd4da0 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -3685,15 +3685,18 @@ disassemble_section (bfd *abfd, asection *section, void *inf) next_sym } loop_until; - /* Sections that do not contain machine - code are not normally disassembled. */ - if (! disassemble_all - && only_list == NULL - && ((section->flags & (SEC_CODE | SEC_HAS_CONTENTS)) - != (SEC_CODE | SEC_HAS_CONTENTS))) - return; + if (only_list == NULL) + { + /* Sections that do not contain machine + code are not normally disassembled. */ + if ((section->flags & SEC_HAS_CONTENTS) == 0) + return; - if (! process_section_p (section)) + if (! disassemble_all + && (section->flags & SEC_CODE) == 0) + return; + } + else if (!process_section_p (section)) return; datasize = bfd_section_size (section); @@ -4970,10 +4973,12 @@ dump_section (bfd *abfd, asection *section, void *dummy ATTRIBUTE_UNUSED) int count; int width; - if (! process_section_p (section)) - return; - - if ((section->flags & SEC_HAS_CONTENTS) == 0) + if (only_list == NULL) + { + if ((section->flags & SEC_HAS_CONTENTS) == 0) + return; + } + else if (!process_section_p (section)) return; if ((datasize = bfd_section_size (section)) == 0) diff --git a/gas/testsuite/gas/ppc/xcoff-tls-32.d b/gas/testsuite/gas/ppc/xcoff-tls-32.d index eb71df09e41..c20e01c410c 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 7f3b6ebceb6..f24f89ecec2 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) .* diff --git a/ld/testsuite/ld-msp430-elf/main-bss-lower.d b/ld/testsuite/ld-msp430-elf/main-bss-lower.d index 60074209e9d..489dddbe8d6 100644 --- a/ld/testsuite/ld-msp430-elf/main-bss-lower.d +++ b/ld/testsuite/ld-msp430-elf/main-bss-lower.d @@ -1,3 +1,3 @@ #... -Disassembly of section .lower.bss: +.* \.lower\.bss +0+14 .* #pass diff --git a/ld/testsuite/ld-msp430-elf/main-bss-upper.d b/ld/testsuite/ld-msp430-elf/main-bss-upper.d index 2f6376a7b65..ad410e5b576 100644 --- a/ld/testsuite/ld-msp430-elf/main-bss-upper.d +++ b/ld/testsuite/ld-msp430-elf/main-bss-upper.d @@ -1,3 +1,3 @@ #... -Disassembly of section .upper.bss: +.* \.upper\.bss +0+14 .* #pass diff --git a/ld/testsuite/ld-msp430-elf/main-const-lower.d b/ld/testsuite/ld-msp430-elf/main-const-lower.d index 8549961bf4f..0b639dac37b 100644 --- a/ld/testsuite/ld-msp430-elf/main-const-lower.d +++ b/ld/testsuite/ld-msp430-elf/main-const-lower.d @@ -1,3 +1,3 @@ #... -Disassembly of section .lower.rodata: +.* \.lower\.rodata +0+14 .* #pass diff --git a/ld/testsuite/ld-msp430-elf/main-const-upper.d b/ld/testsuite/ld-msp430-elf/main-const-upper.d index c84d649c4e0..7dd078dd1bd 100644 --- a/ld/testsuite/ld-msp430-elf/main-const-upper.d +++ b/ld/testsuite/ld-msp430-elf/main-const-upper.d @@ -1,3 +1,3 @@ #... -Disassembly of section .upper.rodata: +.* \.upper\.rodata +0+14 .* #pass diff --git a/ld/testsuite/ld-msp430-elf/main-text-lower.d b/ld/testsuite/ld-msp430-elf/main-text-lower.d index 446a305a22c..9f3442c362b 100644 --- a/ld/testsuite/ld-msp430-elf/main-text-lower.d +++ b/ld/testsuite/ld-msp430-elf/main-text-lower.d @@ -1,3 +1,3 @@ #... -Disassembly of section .lower.text: +.* \.lower\.text +0+38 .* #pass diff --git a/ld/testsuite/ld-msp430-elf/main-text-upper.d b/ld/testsuite/ld-msp430-elf/main-text-upper.d index f7ae6af2701..712f5486c57 100644 --- a/ld/testsuite/ld-msp430-elf/main-text-upper.d +++ b/ld/testsuite/ld-msp430-elf/main-text-upper.d @@ -1,6 +1,3 @@ - -.*: file format.*msp430.* - - -Disassembly of section .upper.text: #... +.* \.upper\.text +0+38 .* +#pass diff --git a/ld/testsuite/ld-msp430-elf/main-var-lower.d b/ld/testsuite/ld-msp430-elf/main-var-lower.d index f520cf5676d..7f214b53793 100644 --- a/ld/testsuite/ld-msp430-elf/main-var-lower.d +++ b/ld/testsuite/ld-msp430-elf/main-var-lower.d @@ -1,3 +1,3 @@ #... -Disassembly of section .lower.data: +.* \.lower\.data +0+14 .* #pass diff --git a/ld/testsuite/ld-msp430-elf/main-var-upper.d b/ld/testsuite/ld-msp430-elf/main-var-upper.d index fc3d712c87a..9443f705585 100644 --- a/ld/testsuite/ld-msp430-elf/main-var-upper.d +++ b/ld/testsuite/ld-msp430-elf/main-var-upper.d @@ -1,3 +1,3 @@ #... -Disassembly of section .upper.data: +.* \.upper\.data +0+14 .* #pass diff --git a/ld/testsuite/ld-msp430-elf/msp430-elf.exp b/ld/testsuite/ld-msp430-elf/msp430-elf.exp index 89c7f3951bc..0e1a1c94622 100644 --- a/ld/testsuite/ld-msp430-elf/msp430-elf.exp +++ b/ld/testsuite/ld-msp430-elf/msp430-elf.exp @@ -49,106 +49,106 @@ if { ![istarget "msp430*elf*"] } { set msp430regionprefixtests { {"Move main() to .upper.text" "-T msp430.ld --code-region=upper" - "" "" {main-with-text-rodata.s} {{objdump -d main-text-upper.d}} "main-upper"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-text-upper.d}} "main-upper"} {"Move main() to .upper.text. No .lower.text in ld script" "-T msp430-no-lower.ld --code-region=upper" - "" "" {main-with-text-rodata.s} {{objdump -d main-text-upper.d}} "main-upper"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-text-upper.d}} "main-upper"} {"Move main() to .lower.text" "-T msp430.ld --code-region=lower" - "" "" {main-with-text-rodata.s} {{objdump -d main-text-lower.d}} "main-lower"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-text-lower.d}} "main-lower"} {"Move \"either\" main() to .lower.text" "-T msp430.ld --code-region=either" - "" "" {main-with-text-rodata.s} {{objdump -d main-text-lower.d}} "main-either"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-text-lower.d}} "main-either"} {"Move glob_var to .upper.data" "-T msp430.ld --data-region=upper" - "" "" {main-with-data-bss.s} {{objdump -D main-var-upper.d}} "main-var-upper"} + "" "" {main-with-data-bss.s} {{objdump -wh main-var-upper.d}} "main-var-upper"} {"Move glob_var to .upper.data. No .lower.data in ld script" "-T msp430-no-lower.ld --data-region=upper" - "" "" {main-with-data-bss.s} {{objdump -D main-var-upper.d}} "main-var-upper"} + "" "" {main-with-data-bss.s} {{objdump -wh main-var-upper.d}} "main-var-upper"} {"Move glob_var to .lower.data" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss.s} {{objdump -D main-var-lower.d}} "main-var-lower"} + "" "" {main-with-data-bss.s} {{objdump -wh main-var-lower.d}} "main-var-lower"} {"Move \"either\" glob_var to .lower.data" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss.s} {{objdump -D main-var-lower.d}} "main-var-lower"} + "" "" {main-with-data-bss.s} {{objdump -wh main-var-lower.d}} "main-var-lower"} {"Move glob_zero to .upper.bss" "-T msp430.ld --data-region=upper" - "" "" {main-with-data-bss.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"} + "" "" {main-with-data-bss.s} {{objdump -wh main-bss-upper.d}} "main-bss-upper"} {"Move glob_zero to .upper.bss. No .lower.bss in ld script." "-T msp430-no-lower.ld --data-region=upper" - "" "" {main-with-data-bss.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"} + "" "" {main-with-data-bss.s} {{objdump -wh main-bss-upper.d}} "main-bss-upper"} {"Move glob_zero to .lower.bss" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"} + "" "" {main-with-data-bss.s} {{objdump -wh main-bss-lower.d}} "main-bss-lower"} {"Move \"either\" glob_zero to .lower.bss" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"} + "" "" {main-with-data-bss.s} {{objdump -wh main-bss-lower.d}} "main-bss-lower"} {"Move glob_const to .upper.rodata" "-T msp430.ld --data-region=upper" - "" "" {main-with-text-rodata.s} {{objdump -D main-const-upper.d}} "main-const-upper"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-const-upper.d}} "main-const-upper"} {"Move glob_const to .upper.rodata. No .lower.rodata in ld script." "-T msp430-no-lower.ld --data-region=upper" - "" "" {main-with-text-rodata.s} {{objdump -D main-const-upper.d}} "main-const-upper"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-const-upper.d}} "main-const-upper"} {"Move glob_const to .lower.rodata" "-T msp430.ld --data-region=lower" - "" "" {main-with-text-rodata.s} {{objdump -D main-const-lower.d}} "main-const-lower"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-const-lower.d}} "main-const-lower"} {"Move \"either\" glob_const to .lower.rodata" "-T msp430.ld --data-region=lower" - "" "" {main-with-text-rodata.s} {{objdump -D main-const-lower.d}} "main-const-lower"} + "" "" {main-with-text-rodata.s} {{objdump -wh main-const-lower.d}} "main-const-lower"} } set msp430regionprefixuniquesectiontests { {"Move main() to .upper.text, with -ffunction/data-sections" "-T msp430.ld --code-region=upper" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-upper.d}} "main-upper"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-text-upper.d}} "main-upper"} {"Move main() to .upper.text. No .lower.text in ld script, with -ffunction/data-sections" "-T msp430-no-lower.ld --code-region=upper" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-upper.d}} "main-upper"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-text-upper.d}} "main-upper"} {"Move main() to .lower.text, with -ffunction/data-sections" "-T msp430.ld --code-region=lower" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-lower.d}} "main-lower"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-text-lower.d}} "main-lower"} {"Move \"either\" main() to .lower.text, with -ffunction/data-sections" "-T msp430.ld --code-region=either" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-lower.d}} "main-either"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-text-lower.d}} "main-either"} {"Move glob_var to .upper.data, with -ffunction/data-sections" "-T msp430.ld --data-region=upper" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-upper.d}} "main-var-upper"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-var-upper.d}} "main-var-upper"} {"Move glob_var to .upper.data. No .lower.data in ld script, with -ffunction/data-sections" "-T msp430-no-lower.ld --data-region=upper" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-upper.d}} "main-var-upper"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-var-upper.d}} "main-var-upper"} {"Move glob_var to .lower.data, with -ffunction/data-sections" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-lower.d}} "main-var-lower"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-var-lower.d}} "main-var-lower"} {"Move \"either\" glob_var to .lower.data, with -ffunction/data-sections" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-lower.d}} "main-var-lower"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-var-lower.d}} "main-var-lower"} {"Move glob_zero to .upper.bss, with -ffunction/data-sections" "-T msp430.ld --data-region=upper" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-bss-upper.d}} "main-bss-upper"} {"Move glob_zero to .upper.bss. No .lower.bss in ld script., with -ffunction/data-sections" "-T msp430-no-lower.ld --data-region=upper" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-bss-upper.d}} "main-bss-upper"} {"Move glob_zero to .lower.bss, with -ffunction/data-sections" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-bss-lower.d}} "main-bss-lower"} {"Move \"either\" glob_zero to .lower.bss, with -ffunction/data-sections" "-T msp430.ld --data-region=lower" - "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"} + "" "" {main-with-data-bss-unique-sec.s} {{objdump -wh main-bss-lower.d}} "main-bss-lower"} {"Move glob_const to .upper.rodata, with -ffunction/data-sections" "-T msp430.ld --data-region=upper" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-upper.d}} "main-const-upper"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-const-upper.d}} "main-const-upper"} {"Move glob_const to .upper.rodata. No .lower.rodata in ld script., with -ffunction/data-sections" "-T msp430-no-lower.ld --data-region=upper" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-upper.d}} "main-const-upper"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-const-upper.d}} "main-const-upper"} {"Move glob_const to .lower.rodata, with -ffunction/data-sections" "-T msp430.ld --data-region=lower" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-lower.d}} "main-const-lower"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-const-lower.d}} "main-const-lower"} {"Move \"either\" glob_const to .lower.rodata, with -ffunction/data-sections" "-T msp430.ld --data-region=lower" - "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-lower.d}} "main-const-lower"} + "" "" {main-with-text-rodata-unique-sec.s} {{objdump -wh main-const-lower.d}} "main-const-lower"} } set msp430eithershuffletests { {"Move \"either\" main() to .upper.text when it doesn\'t fit in .lower.text" "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata.s} - {{objdump -d main-text-upper.d}} "either-to-upper-text"} + {{objdump -wh main-text-upper.d}} "either-to-upper-text"} {"Move \"either\" glob_var_array to .upper.data when it doesn\'t fit in .lower.data" "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss.s} - {{objdump -D main-var-upper.d}} "either-to-upper-data"} + {{objdump -wh main-var-upper.d}} "either-to-upper-data"} {"Move \"either\" glob_bss_array to .upper.bss when it doesn\'t fit in .lower.bss" "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss.s} - {{objdump -D main-bss-upper.d}} "either-to-upper-bss"} + {{objdump -wh main-bss-upper.d}} "either-to-upper-bss"} {"Move \"either\" glob_const_array to .upper.rodata when it doesn\'t fit in .lower.rodata" "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata.s} - {{objdump -D main-const-upper.d}} "either-to-upper-const"} + {{objdump -wh main-const-upper.d}} "either-to-upper-const"} {"Move \"either\" main() to .upper.text when it doesn\'t fit in .lower.text, with -ffunction/data-sections" "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata-unique-sec.s} - {{objdump -d main-text-upper.d}} "either-to-upper-text-unique-sec"} + {{objdump -wh main-text-upper.d}} "either-to-upper-text-unique-sec"} {"Move \"either\" glob_var_array to .upper.data when it doesn\'t fit in .lower.data, with -ffunction/data-sections" "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss-unique-sec.s} - {{objdump -D main-var-upper.d}} "either-to-upper-data-unique-sec"} + {{objdump -wh main-var-upper.d}} "either-to-upper-data-unique-sec"} {"Move \"either\" glob_bss_array to .upper.bss when it doesn\'t fit in .lower.bss, with -ffunction/data-sections" "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss-unique-sec.s} - {{objdump -D main-bss-upper.d}} "either-to-upper-bss-unique-sec"} + {{objdump -wh main-bss-upper.d}} "either-to-upper-bss-unique-sec"} {"Move \"either\" glob_const_array to .upper.rodata when it doesn\'t fit in .lower.rodata, with -ffunction/data-sections" "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata-unique-sec.s} - {{objdump -D main-const-upper.d}} "either-to-upper-const-unique-sec"} + {{objdump -wh main-const-upper.d}} "either-to-upper-const-unique-sec"} } set msp430warntests { diff --git a/ld/testsuite/ld-spu/ear.d b/ld/testsuite/ld-spu/ear.d index df5546fb60f..8c6435e5366 100644 --- a/ld/testsuite/ld-spu/ear.d +++ b/ld/testsuite/ld-spu/ear.d @@ -1,5 +1,5 @@ #as: -#objdump: -Dr +#objdump: -Dr -j.text -j.data -j.toe -j.data.blah #name: ear .*: +file format .* diff --git a/ld/testsuite/ld-spu/icache1.d b/ld/testsuite/ld-spu/icache1.d index 27dc99e41be..a4c8c5a5bfe 100644 --- a/ld/testsuite/ld-spu/icache1.d +++ b/ld/testsuite/ld-spu/icache1.d @@ -1,6 +1,6 @@ #source: icache1.s #ld: --soft-icache --num-lines=4 --non-ia-text --auto-overlay=tmpdir/icache1.lnk --auto-relink -#objdump: -D +#objdump: -D -j.text -j.data -j.bss -j.ovl.init -j.ovly1 -j.ovly2 -j.ovly3 -j.ovly4 -j.ovly5 -j.ovly6 -j.ovly7 -j.ovly8 .* elf32-spu diff --git a/ld/testsuite/ld-spu/ovl.d b/ld/testsuite/ld-spu/ovl.d index cbf7573a642..a0372a0e2fd 100644 --- a/ld/testsuite/ld-spu/ovl.d +++ b/ld/testsuite/ld-spu/ovl.d @@ -1,6 +1,6 @@ #source: ovl.s #ld: -N -T ovl1.lnk -T ovl.lnk --emit-relocs -#objdump: -D -r +#objdump: -D -r -j.text -j.ov_a1 -j.ov_a2 -j.data -j.toe -j.note.spu_name .*elf32-spu diff --git a/ld/testsuite/ld-spu/ovl2.d b/ld/testsuite/ld-spu/ovl2.d index b1e344c456a..b8570c069d1 100644 --- a/ld/testsuite/ld-spu/ovl2.d +++ b/ld/testsuite/ld-spu/ovl2.d @@ -1,6 +1,6 @@ #source: ovl2.s #ld: -N -T ovl2.lnk -T ovl.lnk --emit-relocs -#objdump: -D -r +#objdump: -D -r -j.text -j.ov_a1 -j.ov_a2 -j.data -j.toe -j.nonalloc -j.note.spu_name .*elf32-spu