Message ID | 20230810022140.3030-1-hejinyang@loongson.cn |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp134706vqi; Wed, 9 Aug 2023 19:22:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFfCceHWaeS8BD2t4zRql7D1wBLb+Y3ESx3U6vy+qI22arMZkL3Wg0A+rtbKtlLNkz1Bw3 X-Received: by 2002:a17:906:1da1:b0:99c:3da8:63a9 with SMTP id u1-20020a1709061da100b0099c3da863a9mr725235ejh.29.1691634154966; Wed, 09 Aug 2023 19:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691634154; cv=none; d=google.com; s=arc-20160816; b=RouerXUqfScCKASdOigTimWQTPxbJbqQTVCpFcVHyFNtHqOEal8HdTWMouzepPoEbc LjVIyeQ3zz1RJblShGiZgYWMK5t4Q8wCinSovJ60rQOu5Ln39mLQpUjNatbAvSh9r6MX GfkWx6ApAgFNmAxY3eQDNviGmeFephdWBUA4zRxztDBjdeZ6uYY9E/W/R0gWWbvzHpvE 9dI5h6F1BuDlYmWYm66nrduH6UzgRmzWgPP0M6j9u5j0D2UK4wPfvj85/LiLra+VAube 2B/Ga+CZ7R3ai2KCc6XzZDp9TGvbVSkERulkZaziM6QBCtYU9SPidStZ1HKcNzBiVP9M TcKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=gtPFfXrWDQ7IUe/zVZJLyig4hqDJzNPZzthv9+WAy8Y=; fh=Rlu8LUw4dSibW39jD1Da4YJl8wDqrJ+kfh1Q2psGUc4=; b=pwvt5UWZu0Iuot3CexPGDonXnlZQuvSi0t0h9EZQL/H5bzyweNQSazcZXe7lrGra9B pihjirGlaAmGysdTdNjgZN5yK3UxglZ7pqgHNkEI7d995Q5VbwK9XdKQzC18MyIwtAgY 3Cn1ugKGm00SqoY6jXYESfdRSPCXLsnVp2sVXrdzJ+4BnmPd71ggkZxBfZm8NKFsFVso wLQtL/+aFmVNymBibjh4EFRXx/Z9FMQ1BfDeywyi4Ntk0CI/riUUM82U6lfJrZfKKdPc JO0pPdLK0YqC/qotfsTN0cpWLlDSWe8ZJp+nIEVb5P5BSua3/nmsyfwu56G4WGd34Psy Kqhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id v17-20020a17090690d100b00988c64dd7acsi511243ejw.620.2023.08.09.19.22.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 19:22:34 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7865C3858288 for <ouuuleilei@gmail.com>; Thu, 10 Aug 2023 02:22:32 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 991FC3858D20 for <binutils@sourceware.org>; Thu, 10 Aug 2023 02:22:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 991FC3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [111.9.175.10]) by gateway (Coremail) with SMTP id _____8Dxg_DdSdRkfksUAA--.44273S3; Thu, 10 Aug 2023 10:22:22 +0800 (CST) Received: from localhost.localdomain (unknown [111.9.175.10]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxzyPcSdRks0ZSAA--.33900S2; Thu, 10 Aug 2023 10:22:21 +0800 (CST) From: Jinyang He <hejinyang@loongson.cn> To: Nick Clifton <nickc@redhat.com>, mengqinggang <mengqinggang@loongson.cn> Cc: binutils@sourceware.org, Xing Li <lixing@loongson.cn>, Xi Ruoyao <xry111@xry111.site> Subject: [PATCH] Make sure DW_CFA_advance_loc4 is in the same frag Date: Thu, 10 Aug 2023 10:21:40 +0800 Message-Id: <20230810022140.3030-1-hejinyang@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8AxzyPcSdRks0ZSAA--.33900S2 X-CM-SenderInfo: pkhmx0p1dqwqxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj9xXoWrKryfXw45KFykur17ZF1rZrc_yoWDGFc_WF yUZw48Z34xG39rX3ZrCF45G3ySqF10gF4DuFZruryUZw15Grs8AFykXry5KF45u3y0gr93 Jw45Gryru3W2gosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb78YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwA2z4x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8 JVW8Jr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU1EksDUUUUU== X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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 <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773806975461652310 X-GMAIL-MSGID: 1773806975461652310 |
Series |
Make sure DW_CFA_advance_loc4 is in the same frag
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Jinyang He
Aug. 10, 2023, 2:21 a.m. UTC
The DW_CFA_advance_loc4 may be in different frags. Then fr_fix may caused something wrong. Referenced by commit b9d8f5601bcf ("Re: Optimise away eh_frame advance_loc 0"). gas/ChangeLog: * ehopt.c (check_eh_frame): Don't allow DW_CFA_advance_loc4 to be placed in a different frag to the rs_cfa. --- BTW, it is a bug I triggered when compiling a LoongArch.asm file with relaxation being enabled. I hope it could be merged to 2.41 as bug-fix. gas/ehopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Aug 10, 2023 at 10:21:40AM +0800, Jinyang He wrote: > The DW_CFA_advance_loc4 may be in different frags. Then fr_fix > may caused something wrong. Referenced by commit b9d8f5601bcf > ("Re: Optimise away eh_frame advance_loc 0"). > > gas/ChangeLog: > > * ehopt.c (check_eh_frame): Don't allow DW_CFA_advance_loc4 > to be placed in a different frag to the rs_cfa. OK.
On 10.08.2023 04:21, Jinyang He wrote: > The DW_CFA_advance_loc4 may be in different frags. Then fr_fix > may caused something wrong. Referenced by commit b9d8f5601bcf > ("Re: Optimise away eh_frame advance_loc 0"). I'm afraid I don't understand that earlier fix: frag_more(1) there ought to guarantee fr_fix (once the frag is closed) to be >= 1. It would then seem to me that ... > --- a/gas/ehopt.c > +++ b/gas/ehopt.c > @@ -386,7 +386,7 @@ check_eh_frame (expressionS *exp, unsigned int *pnbytes) > { > /* This might be a DW_CFA_advance_loc4. Record the frag and the > position within the frag, so that we can change it later. */ > - frag_grow (1); > + frag_grow (1 + 4); > d->state = state_saw_loc4; > d->loc4_frag = frag_now; > d->loc4_fix = frag_now_fix (); ... here instead we also need frag_more (1); d->state = state_saw_loc4; d->loc4_frag = frag_now; d->loc4_fix = frag_now_fix () - 1; Otoh if frags were always grown (there and here), couldn't we do away with loc4_frag and loc4_fix? As to your 2.41 question: You realize the release was already cut? Putting this (or whichever else) fix there would be likely be okay, but would have a real effect only if 2.41.1 was ever made. Jan
diff --git a/gas/ehopt.c b/gas/ehopt.c index feea61b92..9d6606adf 100644 --- a/gas/ehopt.c +++ b/gas/ehopt.c @@ -386,7 +386,7 @@ check_eh_frame (expressionS *exp, unsigned int *pnbytes) { /* This might be a DW_CFA_advance_loc4. Record the frag and the position within the frag, so that we can change it later. */ - frag_grow (1); + frag_grow (1 + 4); d->state = state_saw_loc4; d->loc4_frag = frag_now; d->loc4_fix = frag_now_fix ();