From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by sourceware.org (Postfix) with ESMTP id B6EC7385700B for ; Tue, 3 Oct 2023 11:56:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6EC7385700B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id D558592009C; Tue, 3 Oct 2023 13:56:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id D1FFD92009B; Tue, 3 Oct 2023 12:56:49 +0100 (BST) Date: Tue, 3 Oct 2023 12:56:49 +0100 (BST) From: "Maciej W. Rozycki" To: YunQiang Su cc: binutils@sourceware.org, Nick Clifton Subject: Re: [PATCH] MIPS: fix readelf -S bintest test for N64 triples In-Reply-To: <20230817034046.438336-1-yunqiang.su@cipunited.com> Message-ID: References: <20230817034046.438336-1-yunqiang.su@cipunited.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1169.3 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,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 List-Id: On Thu, 17 Aug 2023, YunQiang Su wrote: > MIPS N64 has different section layout. Let's add a new file > readelf.s-64-tmips. > > It can fix this test fail on mips64*-linux-gnuabi64 and mips64*-openbsd. I actually had to chase readelf.exp and dive into it so as to find out whether and why this approach is correct. This could have been mentioned in the description. Also due to how the test is called it wasn't clear to me from the description itself what test is actually affected. > diff --git a/binutils/testsuite/binutils-all/readelf.s-64-tmips b/binutils/testsuite/binutils-all/readelf.s-64-tmips > new file mode 100644 > index 00000000000..5c19027d0b7 > --- /dev/null > +++ b/binutils/testsuite/binutils-all/readelf.s-64-tmips > @@ -0,0 +1,25 @@ > +There are .* section headers, starting at offset .*: > + > +Section Headers: > + +\[Nr\] Name +Type +Address +Offset > + +Size +EntSize +Flags +Link +Info +Align > + +\[ 0\] +NULL +0000000000000000 +00000000 > + +0000000000000000 +0000000000000000 +0 +0 +0 > + +\[ 1\] .text +PROGBITS +0000000000000000 +00000040 > + +00000000000000.. +0000000000000000 +AX +0 +0 +.* > + +\[ 2\] .rel.+text +REL. +0+ +0+.* > + +000000000000001. +000000000000001. +I +. +1 +8 > + +\[ 3\] .data +PROGBITS +0000000000000000 +000000(48|50) > + +0000000000000010 +0000000000000000 +WA +0 +0 +.* > + +\[ 4\] .bss +NOBITS +0000000000000000 +00000060 > + +0000000000000000 +0000000000000000 +WA +0 +0 +.* > +# .MIPS.options, .MIPS.abiflags, .pdr, .gnu.attributes here > +#... > + +\[ .\] .symtab +SYMTAB +0000000000000000 +0+.* > + +0+.* +0000000000000018 +10 +10 +8 > + +\[10\] .strtab +STRTAB +0000000000000000 +0+.* > + +0+.* +0000000000000000 .* +0 +0 +1 > + +\[11\] .shstrtab +STRTAB +0000000000000000 +[0-9a-f]+ > + +00000000000000.. +0000000000000000 .* +0 +0 +.* > +Key to Flags: > +#... Since the scope for this dump is so narrow there is no need to wildcard-match output produced. It can be an exact match for easier detection of unwanted changes in output, just as the original readelf.s dump used to be. Also #... at the end is unusual, #pass can be used to terminate matching successfully right away rather than wading through the rest of output only to ignore it. I have committed the change with these updates made for you, posted separately, thank you for your contribution. Maciej