From patchwork Fri Feb 17 04:49: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: 58348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp696534wrn; Thu, 16 Feb 2023 20:49:45 -0800 (PST) X-Google-Smtp-Source: AK7set8MLywCJi87l8ZEsknaQRMGBuT5unqIpDKzf8P1v7yB2WSjUgqEiVUqr1g2z3iHCrecEugp X-Received: by 2002:a17:907:7206:b0:8b2:e93:3f59 with SMTP id dr6-20020a170907720600b008b20e933f59mr986494ejc.31.1676609385613; Thu, 16 Feb 2023 20:49:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676609385; cv=none; d=google.com; s=arc-20160816; b=Wp1d0s3g9CzVZJmpeSijhEp9gBwcgRbqY9Jn8pHYbcAkG7fPAbsOfpxOArSFv9mZBb BrqbBSI+Zn+tNP+9BEn4kSxa+6RnLL1YyyS0+m2yqXE0SEBX257/AF+C75H7nfGFNinL y6E0TnvL9eAK8BNClLbN2JQRsGbo5dAH4EorW+s5auY0CO8KYgBsvhLM91E0K4Q+fmFW tsRoOPKyJa3LgJdgkqYf8jkpXsm1SiEGzerkkZqa89QpQtx4WPuZMWo4Vc7DuCvA7qBp Q4UNFmphtcxdVbw8iULogXWSJ5ZWCSGLwH+8LosXJe1Qk0knULNW2QJ3RPqcvzjw5AQE Uo6w== 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=dVq2/GxtHTPK0hNRhSZY/IJX4pR5Z4wBn300eYrT7kg=; b=Sh2wN4q/hxPFymDqhmGDpqMd3Z6FtvvGq3rtkvLnKl77f8CmZ5NsMAdufdwJ2siSlV dl8Ia3pCsXD6MLlSh2Wa5raxgpWO/mIpI3LMljkmRzimP7uJuNuiv8Huj6UayImd1ayF z4+HUZhFUcfEhNEgptPCftCgNuDCkmqhij2Vzm6oIAiHWcxk7pKVV5Y50tI/HMjVJ8LY Qx7OxBKNqYHqsli06kWJ0+8H7PAcHuYBOrYCaHyJNBzcWa9C/nSCpHoOlSGtwJXu97+b YDvogmI1yZbZ3fozw4YZqIcTo/Pc6H3WVNetLbKBphjVUJrqyRrTQ6mvGRFSJ6YYCjw/ XyUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sSEMsAzi; 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 if19-20020a170906df5300b008b12da2695bsi3889035ejc.993.2023.02.16.20.49.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 20:49:45 -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=sSEMsAzi; 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 F2D8D38560A6 for ; Fri, 17 Feb 2023 04:49:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2D8D38560A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676609383; bh=dVq2/GxtHTPK0hNRhSZY/IJX4pR5Z4wBn300eYrT7kg=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=sSEMsAziMWzllYOpC2ggZOmk0bVAx0X1kPQOoYKx6e0mm/XvcEMP5in5uRimJcUQI ZU+HtS6ynwmGaG2x/JdLUIyA1AE8ZhknhA6iQ4Er28eFpjCWOgJPEUkHP9AUsCjgPS HCsRfrAO4NJOQOheJyxjRlAUDIxiXqkmVNPYYlyU= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id 612CB3858D33 for ; Fri, 17 Feb 2023 04:49:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 612CB3858D33 Received: by mail-pj1-x102c.google.com with SMTP id x4-20020a17090a388400b002349a303ca5so3917310pjb.4 for ; Thu, 16 Feb 2023 20:49:33 -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=dVq2/GxtHTPK0hNRhSZY/IJX4pR5Z4wBn300eYrT7kg=; b=pYpUphmBtcWq/ch4oVy2nY825YD8ECT03a/Myybx2agVuolx34eHw4mvi0FuqkjeaV piro+2nT1mlvCJyOchbfBbIzOG5teNuoRsB236AOOH4R8ZwvRoJbYwieqjzXegeW9glk 2oV/38LdfMRIhdWjYrsavNOkdjHRNs8YuicCP2TLoEyTGrvgUL/d9adnsvEToVYZWqSF aF54QSaEpJOWVuQC87McB/o1wzP0FnP3PLogLuvv4tYjOBs5xz9Q1SA9wz6P01Bd2UaJ zsaCzHh/yec8m2LFxoHnDe2Se107pYSQMuGAXbJQj2zzIyu8OBCGMb4k04YoukOjYF/N gglA== X-Gm-Message-State: AO0yUKWJ/+13UzqwLPvdshAEZSoXbe8/7KZF8GzPxR4y0tkcOIL0D2n3 kBZnTBmtoHuGkjPwcLhbErHa0p8w7nc= X-Received: by 2002:a17:90b:4d84:b0:233:f990:d646 with SMTP id oj4-20020a17090b4d8400b00233f990d646mr9616490pjb.35.1676609372137; Thu, 16 Feb 2023 20:49:32 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:1206:224d:8564:72b6]) by smtp.gmail.com with ESMTPSA id b10-20020a17090a8c8a00b00233e94d4b68sm4078041pjo.14.2023.02.16.20.49.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 20:49:31 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 7E40B11420C8; Fri, 17 Feb 2023 15:19:29 +1030 (ACDT) Date: Fri, 17 Feb 2023 15:19:29 +1030 To: binutils@sourceware.org Subject: ld test asciz and ascii fails Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3034.9 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?1758052363386186984?= X-GMAIL-MSGID: =?utf-8?q?1758052363386186984?= Fix these fails: alpha-dec-vms +FAIL: ld-scripts/asciz alpha-dec-vms +FAIL: ld-scripts/ascii i386-go32 +FAIL: ld-scripts/asciz sh-coff +FAIL: ld-scripts/asciz It's better to positively select targets for .section support than to try to exclude all targets that don't. Make a new is_coff_format so we can easily select such. binutils/ * testsuite/lib/binutils-common.exp (is_coff_format): New. ld/ * testsuite/ld-scripts/ascii.d: Use is_elf_format and is_coff_format to select targets, exclude ti coff. * testsuite/ld-scripts/asciz.d: Likewise. Accept trailing zeros. diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp index b0190ac51ac..ab752417295 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -112,6 +112,21 @@ proc is_pecoff_format args { return 0 } +# True if the object format is known to COFF or PE (but not ECOFF or XCOFF) +# +proc is_coff_format {} { + if { [is_pecoff_format] + || [istarget *-*-coff*] + || [istarget *-*-go32*] + || [istarget *-*-msdosdjgpp*] + || [istarget tic4x-*-*] + || [istarget tic54x-*-*] + || [istarget z8k-*-*] } { + return 1 + } + return 0 +} + proc is_som_format {} { if { ![istarget hppa*-*-*] || [istarget hppa*64*-*-*] } { return 0; diff --git a/ld/testsuite/ld-scripts/ascii.d b/ld/testsuite/ld-scripts/ascii.d index cfc1a4cbdba..ff3bd328c15 100644 --- a/ld/testsuite/ld-scripts/ascii.d +++ b/ld/testsuite/ld-scripts/ascii.d @@ -1,8 +1,8 @@ #source: ascii.s #ld: -T ascii.t #objdump: -s -j .header -#notarget: [is_aout_format] -#skip: tic4x-*-* tic54x-*-* *-*-*ecoff *-*-macho *-*-aix* +#target: [is_elf_format] [is_coff_format] +#notarget: tic4x-*-* tic54x-*-* .*: file format .* diff --git a/ld/testsuite/ld-scripts/asciz.d b/ld/testsuite/ld-scripts/asciz.d index 75e3c858a07..38d0408b6e9 100644 --- a/ld/testsuite/ld-scripts/asciz.d +++ b/ld/testsuite/ld-scripts/asciz.d @@ -1,8 +1,8 @@ #source: asciz.s #ld: -T asciz.t #objdump: -s -j .data -#notarget: [is_aout_format] -#skip: tic4x-*-* tic54x-*-* *-*-*ecoff *-*-macho *-*-aix* +#target: [is_elf_format] [is_coff_format] +#notarget: tic4x-*-* tic54x-*-* .*: file format .* @@ -10,5 +10,5 @@ Contents of section .data: .... 54686973 20697320 61207374 72696e67 This is a string .... 00546869 73206973 20616e6f 74686572 .This is another .... 0a537472 696e6700 006e6f71 756f7465 .String..noquote - .... 7300 s. + .... 7300[ 0]* s.* #pass