From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by sourceware.org (Postfix) with ESMTPS id EF0EE3885C1B for ; Sat, 28 Mar 2020 00:52:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EF0EE3885C1B Received: by mail-pf1-x443.google.com with SMTP id f206so5348521pfa.10 for ; Fri, 27 Mar 2020 17:52:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Jg1onRhj+rF/w9DbSigCw6tgcesiZtRiTYdOJroLCuI=; b=uYEaMfYjj477OpKnK3K6opbc1GUUpT7gRRxadn6KJXP+naPUCnN+8pvFGi8bnoEdhD H+sFoQesLuP3GI6hSBoKsaGdDW+Yw5CjDLDVYP6H9Ww8aXbhav9Ga6wRWIlGP/62+WoF Oe931Nh/k6VtP+NX8WxTaSZX+NWqqyWWFL2vO0ttrDpxFrTEwaGQxMdGKJc4be5/hw7B JPfW8OkGiVbv5uCQ+yLRTvmNIsxZelbZSFbe41OqwrwwpJscZaRmEVO+elGGV3s7PyRe 83iXaObK5hALwx878aW5Aeb1XOe1on92Iuj527ekP9K1Vb6tEoB2sW7xpLloxLhm+DJP 5Npw== X-Gm-Message-State: ANhLgQ3ta70ovLy6rx8zqYui2bKDgnXKDe8z24AS/lUxIZrr3O37YDBb 6vNbPCfE3S8H4bN0Or6m0xIVLW+6wt0= X-Google-Smtp-Source: ADFU+vtKAkWTOzE9ms5OkGEWVtidaxfZJ7SkxuSPH2KeY5lC1CJJuSwAndvSNeNBdF3L96fIPiL0nw== X-Received: by 2002:a63:8c56:: with SMTP id q22mr2057288pgn.154.1585356760099; Fri, 27 Mar 2020 17:52:40 -0700 (PDT) Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id 5sm5037454pfw.98.2020.03.27.17.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 17:52:39 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id B0BD480DE9; Sat, 28 Mar 2020 11:22:35 +1030 (ACDT) Date: Sat, 28 Mar 2020 11:22:35 +1030 From: Alan Modra To: Hans-Peter Nilsson Cc: Jozef Lawrynowicz , "binutils@sourceware.org" Subject: Re: [PATCH] Add testcase for PR 25662 invalid sh_offset for section Message-ID: <20200328005235.GS4583@bubble.grove.modra.org> References: <20200326111036.4e8e59d6@jozef-kubuntu> <20200326212512.GM4583@bubble.grove.modra.org> <20200327105949.47f1a85c@jozef-kubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-26.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Sat, 28 Mar 2020 00:52:42 -0000 On Fri, Mar 27, 2020 at 05:03:07PM -0400, Hans-Peter Nilsson wrote: > On Fri, 27 Mar 2020, Jozef Lawrynowicz wrote: > > On Fri, 27 Mar 2020 07:55:12 +1030 > > Alan Modra wrote: > > > OK, thanks. Yes, we are going to have some fails with this new test. > > > Hmm, objcopy -p doesn't help with the PE date stamp and it seems like > > > it should. > > > > > > You might like to simplify the LD test. > > > > > > > + set status [remote_exec host $LD -v] > > > > + if { [lindex $status 0] != 0 } { > > > > > > if {[which $LD] == 0} then { > > > > > > > + untested "objcopy $type ($testname)" > > > > + return > > > > + } > > > > > > > Thanks for the tip. Fixed that and pushed to master. > > Your 1fafefd59438 seems to have caused a new failure for my > binutils autotester. With --target mmix-knuth-mmixware: > original 00000000: 9809 0101 5e7e 96c9 9808 0050 0000 0002 ....^~.....P.... 00000010: 2e64 6174 6100 0000 0000 0043 0000 0000 .data......C.... 00000020: 0000 0201 0000 0000 0000 0000 9801 0002 ................ 00000030: 0000 0000 0000 0200 0000 0000 9808 0050 ...............P 00000040: 0000 0002 2e74 6578 7400 0000 0000 0033 .....text......3 00000050: 0000 0000 0000 0004 0000 0000 0000 1204 ................ 00000060: 9801 0002 0000 0000 0000 1204 0000 0000 ................ 00000070: 980a 00ff 0000 0000 0000 1204 980b 0000 ................ 00000080: 203a 304d 2061 2069 026e 1204 8120 5f20 :0M a i.n... _ 00000090: 7320 7420 6120 7202 7412 0482 980c 0007 s t a r.t....... copy 00000000: 9809 0101 5e7e 96c9 9808 0050 0000 0002 ....^~.....P.... 00000010: 2e74 6578 7400 0000 0000 0033 0000 0000 .text......3.... 00000020: 0000 0004 0000 0000 0000 1204 9801 0002 ................ 00000030: 0000 0000 0000 1204 0000 0000 9808 0050 ...............P 00000040: 0000 0002 2e64 6174 6100 0000 0000 0043 .....data......C 00000050: 0000 0000 0000 0201 0000 0000 0000 0000 ................ 00000060: 9801 0002 0000 0000 0000 0200 0000 0000 ................ 00000070: 980a 00ff 0000 0000 0000 1204 980b 0000 ................ 00000080: 203a 304d 2061 2069 026e 1204 8120 5f20 :0M a i.n... _ 00000090: 7320 7420 6120 7202 7412 0482 980c 0007 s t a r.t....... I think that is just a rearrangement of the object file records, so I'm inclined to xfail the test for mmix. I'll leave that to you Hans-Peter since you know your object format much better than I can understand from the occasional glance at bfd/mmo.c. Meanwhile, to fix an XPASS on tic54x and to xfail some others for the new test, I'm committing the following. xfails spu due to a note section getting a different vma, and some mips targets that give section symbols a name string. I added -p for the executable test in an attempt to fix all the pe target fails, but that doesn't preserve the date/time for some reason. * testsuite/binutils-all/objcopy.exp (objcopy_test): Move xfails from here to calls. Remove "m8*-*-*" entry. Don't xfail tic54x but do xfail spu, mipstx39 and mips-sgi-irix for the executable test. Pass "-p" to objcopy for the executable test. diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index b5c1895f41..0eafcdbede 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -59,6 +59,7 @@ proc objcopy_test {testname srcfile type asflags ldflags} { return } + set xflags "" if { $type == "executable" } { global LD # Check that LD exists @@ -66,6 +67,7 @@ proc objcopy_test {testname srcfile type asflags ldflags} { untested "objcopy $type ($testname)" return } + # Use tempfile and copyfile without the .o extension for executable files set t_tempfile [string range $tempfile 0 end-2] set t_copyfile $copyfile @@ -74,9 +76,10 @@ proc objcopy_test {testname srcfile type asflags ldflags} { unresolved "objcopy $type ($testname)" return } + set xflags "-p" } - set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $t_tempfile $t_copyfile"] + set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $xflags $t_tempfile $t_copyfile"] if ![string equal "" $got] then { fail "objcopy $type ($testname)" @@ -96,19 +99,6 @@ proc objcopy_test {testname srcfile type asflags ldflags} { set exec_output [lindex $status 1] set exec_output [prune_warnings $exec_output] - # On some systems the result of objcopy will not be identical. - # Usually this is just because gas isn't using bfd to write the - # files in the first place, and may order things a little - # differently. Those systems should use setup_xfail here. - - setup_xfail "hppa*-*-*" - setup_xfail "m8*-*" - setup_xfail "sh-*-coff*" - setup_xfail "tic54x-*-*" - - clear_xfail "hppa*64*-*-hpux*" "hppa*-*-linux*" "hppa*-*-lites*" - clear_xfail "hppa*-*-*n*bsd*" "hppa*-*-rtems*" "*-*-*elf*" - if [string equal "" $exec_output] then { pass "objcopy $type ($testname)" } else { @@ -123,6 +113,11 @@ proc objcopy_test {testname srcfile type asflags ldflags} { } } +setup_xfail "hppa*-*-*" +setup_xfail "sh-*-coff*" +setup_xfail "tic54x-*-*" +clear_xfail "hppa*64*-*-hpux*" "hppa*-*-linux*" "hppa*-*-lites*" +clear_xfail "hppa*-*-*n*bsd*" "hppa*-*-rtems*" "*-*-*elf*" objcopy_test "simple copy" bintest.s object "" "" # Test verilog data width @@ -1112,7 +1107,14 @@ set elf64 "" if [is_elf_format] { objcopy_test_symbol_manipulation objcopy_test_elf_common_symbols + + setup_xfail "hppa*-*-*" + setup_xfail "sh-*-coff*" + setup_xfail "tic54x-*-*" + clear_xfail "hppa*64*-*-hpux*" "hppa*-*-linux*" "hppa*-*-lites*" + clear_xfail "hppa*-*-*n*bsd*" "hppa*-*-rtems*" "*-*-*elf*" objcopy_test "ELF unknown section type" unknown.s object "" "" + objcopy_test_readelf "ELF group 1" group.s objcopy_test_readelf "ELF group 2" group-2.s objcopy_test_readelf "ELF group 3" group-3.s @@ -1341,4 +1343,9 @@ run_dump_test "pr23633" run_dump_test "set-section-alignment" +setup_xfail "hppa*-*-*" +setup_xfail "sh-*-coff*" +setup_xfail "mips-*-irix" "mipstx39-*-*" "spu-*-*" +clear_xfail "hppa*64*-*-hpux*" "hppa*-*-linux*" "hppa*-*-lites*" +clear_xfail "hppa*-*-*n*bsd*" "hppa*-*-rtems*" "*-*-*elf*" objcopy_test "pr25662" pr25662.s executable "" "-T$srcdir/$subdir/pr25662.ld" -- Alan Modra Australia Development Lab, IBM