Message ID | 20231206175231.4384-1-palmer@rivosinc.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4275152vqy; Wed, 6 Dec 2023 09:52:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2QPZbFxWFdq/7JNpkOS60X0Q9zxxqWqRiQHTJz/LBDRFGLskptOKm2Pdat8idspIN4CeT X-Received: by 2002:ad4:57d1:0:b0:67a:a721:b19b with SMTP id y17-20020ad457d1000000b0067aa721b19bmr1123194qvx.86.1701885176869; Wed, 06 Dec 2023 09:52:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701885176; cv=pass; d=google.com; s=arc-20160816; b=n04VlN9th9Ob+kX9hAMfIgRd9VIGmnA+w/xFNgs7E7ejwUsZGxQhXBH4PO1+yd4chv LStMrmWXe256M3SwLHa08uyJ8SejSIyH+5bQxiHDQUAhMmNfdI6U4aJXduw03WMDJ5e3 cD1Xpe2vd7QTYmuSSscLI2voyYqRVqFR2gL1sOikE43u8f04z8xaEIQYxcRFch9+X4sX 2YsVzy4+wjFQKg1wswZmbi8ZZfSoopw2JPmveeSKzyLXuJaFq9b40Wa02DEJOVfeJwqd +mkiUqCyxzYocVnb8gQrSVnz8lpXtqY5NwMZf2AntZuCmzf4u2UehErTZB5go0cChBde XiVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:to:from:cc :content-transfer-encoding:mime-version:message-id:date:subject :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=shbIFmj2pr02oREk4k3zewFP46/0eD0ZnF85BIwC8YA=; fh=67iG/PIGUs1nU4GQyLKcU1qyrkiaY4kSqgo+UckSASU=; b=E1MRYuL4YUuOj5TjOjRuSY/5tq49aVpiWziXlmv+aY3dWEA8PJ4x/bh0AjFgwQ6pWY byWnKJ3le4evxZFDaB+NPqDIqTtHhSEn4iRDJCByEBfWOYcPWfkfE3+UhGkx+R8IEI/f pflojVFrBr9RhzJ02MdFU9UOt7Lfd1r41des6oINwiBpW9PN1U3c2VyYfZIN7iPo1JhF U9LTWE4tSmNwB9aByjRcyGEUFJJsdWv01CRrT3QqxH5Bl2uAXEe4Jj2QgUcKXJCgl/Md vqxHf5uUfYJHQ+eWmwqSrBtgGwAAjHqyy8s97SG1+zSDsRCDITEwN2APPBmmQe5l8lYF 2BGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=yZAXmfiC; arc=pass (i=1); 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" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ei6-20020ad45a06000000b0067ab6fd437dsi405345qvb.228.2023.12.06.09.52.56 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:52:56 -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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=yZAXmfiC; arc=pass (i=1); 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1005385DC16 for <ouuuleilei@gmail.com>; Wed, 6 Dec 2023 17:52:56 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by sourceware.org (Postfix) with ESMTPS id 461C138582B3 for <binutils@sourceware.org>; Wed, 6 Dec 2023 17:52:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 461C138582B3 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 461C138582B3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701885171; cv=none; b=rbWRtglq3oxbS1Qo80qy0/jP7QN1dQrQUwc90pjdYoqnkNHKgARVce6dzN5JmwwcAuCVCNYiy9GF2wfawDxixPTuHRsUBvBnCP87yhnhZW07/ztAOgdrQuHaYGk4ryoUPjZC5zFHrBTuvDPrt++ABh6chZpgzvz68R9xW4AtskI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701885171; c=relaxed/simple; bh=8fbVmtNuRPz1rnVKMg4WEY9+Qgs9zIADLFRhjveNT6I=; h=DKIM-Signature:Subject:Date:Message-ID:MIME-Version:From:To; b=LxqzbojBecH+G+dYDLqz2NGXDtVtEp2AvN/ltFXGvLU8Dbcp+vZS0hZZqPGpPvYFH6IvU7JWCMdcJTI7DbOs7vGSZWYHk19ob0xCm/1RksQyq4SOpLyLjwdRjjFZU2NbjykTZ+kELfMabkFXntPX0aNFAzMBp0nKB/TMjDhHxFc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-58d5979c676so2035eaf.1 for <binutils@sourceware.org>; Wed, 06 Dec 2023 09:52:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1701885169; x=1702489969; darn=sourceware.org; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:from:to:cc:subject:date:message-id:reply-to; bh=shbIFmj2pr02oREk4k3zewFP46/0eD0ZnF85BIwC8YA=; b=yZAXmfiC4MN+O4E3rBNUItR+HjnSaDNEc9jneecE4GTMMQ6p3r1vj5CAGyt8HmjSER NPtZZwikB2DxSckJtbfZ0r3uZ+qRYleZVmw0abUaAgY0cX/aQELJK8GzCif6xAUB8up+ HSmAz6cjShjrv4bgPuJ6uE2J1d44Qm8f88z/hkSsKHV3ShdFPP6wLy4Sxjqs03MOTKdn zFCJ6qxo/FANxGO0ZwWhAisZqgdwrJ3F2FOkIWfUug6zRHqwhxr2Zq7MYW7qvAtJ27/4 sJ8tafNr8+nCQ1sM1fPDjqVojb4OYDaJud1KQ3iS2QemCt2QUBeMfnPlF13h8Y9BDL1Z kPeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701885169; x=1702489969; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=shbIFmj2pr02oREk4k3zewFP46/0eD0ZnF85BIwC8YA=; b=LGlzaoht5gcNu0b2jGQQQyuY7azeeFVMIWFlxB7EGMyrVBPeifQZzOabu7+w+heO4d EE3e69xSCHXYZyTKXxQlo9eFHv/PrCPzckV8+2raOszUZzi0XOIYWFJVTgt5/8ia+tmv zOFV+7zbmrUp9l5pvmAzUwGQvjrFPKuO3V8SKQKyXvEKKAX4+BQIDnoPU5ETWZTQB0P0 Xh3XXiyWN6beidoY91kata3Iqi6oTNKACKY4pwUXoX6Q4nrFUYtgCASwDnFwPJZMDcTd LjqlTjWnsaxg6XWXgWL7DeVNdlEk9NWJ6zkOLRkmUu2Fwh3oSLXXmlmZEhcxzslYoboA 0SQQ== X-Gm-Message-State: AOJu0YxB+z10lcw8GX0MfVdO/+wt2DD/4DW42UmP3dK5hkmlJmymlFig GjZeCeV0J7fEHiYtRrE+3Qvk/Q== X-Received: by 2002:a4a:254f:0:b0:58e:1c47:879a with SMTP id v15-20020a4a254f000000b0058e1c47879amr1250298ooe.15.1701885169611; Wed, 06 Dec 2023 09:52:49 -0800 (PST) Received: from localhost ([192.184.165.199]) by smtp.gmail.com with ESMTPSA id g23-20020a4ad317000000b005902a5bc3easm68013oos.22.2023.12.06.09.52.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 09:52:49 -0800 (PST) Subject: [PATCH] RISC-V: Fix "withand" in LEB128 error messages Date: Wed, 6 Dec 2023 09:52:31 -0800 Message-ID: <20231206175231.4384-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Palmer Dabbelt <palmer@rivosinc.com>, David Abdurachmanov <davidlt@rivosinc.com> From: Palmer Dabbelt <palmer@rivosinc.com> To: binutils@sourceware.org X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784555951376043852 X-GMAIL-MSGID: 1784555951376043852 |
Series |
RISC-V: Fix "withand" in LEB128 error messages
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | warning | Git am fail log |
Commit Message
Palmer Dabbelt
Dec. 6, 2023, 5:52 p.m. UTC
This was split over multiple lines and ended up missing a space.
Reported-by: David Abdurachmanov <davidlt@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
bfd/elfnn-riscv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Wed, Dec 6, 2023 at 9:52 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > > This was split over multiple lines and ended up missing a space. > > Reported-by: David Abdurachmanov <davidlt@rivosinc.com> > Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> > --- > bfd/elfnn-riscv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c > index 5c4bf4bc3cb..042266e791b 100644 > --- a/bfd/elfnn-riscv.c > +++ b/bfd/elfnn-riscv.c > @@ -2521,7 +2521,7 @@ riscv_elf_relocate_section (bfd *output_bfd, > else > { > msg = ("Mismatched R_RISCV_SET_ULEB128, it must be paired with" > - "and applied before R_RISCV_SUB_ULEB128"); > + " and applied before R_RISCV_SUB_ULEB128"); > r = bfd_reloc_dangerous; > } > break; > @@ -2537,7 +2537,7 @@ riscv_elf_relocate_section (bfd *output_bfd, > else > { > msg = ("Mismatched R_RISCV_SUB_ULEB128, it must be paired with" > - "and applied after R_RISCV_SET_ULEB128"); > + " and applied after R_RISCV_SET_ULEB128"); > r = bfd_reloc_dangerous; > } > break; > -- > 2.42.1 > LGTM. Ideally this error message should be tested using `#error:` .reloc directive can be used to create a relocation. .reloc ., R_RISCV_SET_ULEB128, w2
On Wed, 06 Dec 2023 10:03:43 PST (-0800), i@maskray.me wrote: > On Wed, Dec 6, 2023 at 9:52 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: >> >> This was split over multiple lines and ended up missing a space. >> >> Reported-by: David Abdurachmanov <davidlt@rivosinc.com> >> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> >> --- >> bfd/elfnn-riscv.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c >> index 5c4bf4bc3cb..042266e791b 100644 >> --- a/bfd/elfnn-riscv.c >> +++ b/bfd/elfnn-riscv.c >> @@ -2521,7 +2521,7 @@ riscv_elf_relocate_section (bfd *output_bfd, >> else >> { >> msg = ("Mismatched R_RISCV_SET_ULEB128, it must be paired with" >> - "and applied before R_RISCV_SUB_ULEB128"); >> + " and applied before R_RISCV_SUB_ULEB128"); >> r = bfd_reloc_dangerous; >> } >> break; >> @@ -2537,7 +2537,7 @@ riscv_elf_relocate_section (bfd *output_bfd, >> else >> { >> msg = ("Mismatched R_RISCV_SUB_ULEB128, it must be paired with" >> - "and applied after R_RISCV_SET_ULEB128"); >> + " and applied after R_RISCV_SET_ULEB128"); >> r = bfd_reloc_dangerous; >> } >> break; >> -- >> 2.42.1 >> > > LGTM. Ideally this error message should be tested using `#error:` > .reloc directive can be used to create a relocation. > > .reloc ., R_RISCV_SET_ULEB128, w2 Ya, seems reasonable. IIUC there's still some discussion in psABI land as to exactly what the required semantics of these are, though, so maybe we hold off on writing tests until things settle down?
On Wed, Dec 6, 2023 at 10:15 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > > On Wed, 06 Dec 2023 10:03:43 PST (-0800), i@maskray.me wrote: > > On Wed, Dec 6, 2023 at 9:52 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > >> > >> This was split over multiple lines and ended up missing a space. > >> > >> Reported-by: David Abdurachmanov <davidlt@rivosinc.com> > >> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> > >> --- > >> bfd/elfnn-riscv.c | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c > >> index 5c4bf4bc3cb..042266e791b 100644 > >> --- a/bfd/elfnn-riscv.c > >> +++ b/bfd/elfnn-riscv.c > >> @@ -2521,7 +2521,7 @@ riscv_elf_relocate_section (bfd *output_bfd, > >> else > >> { > >> msg = ("Mismatched R_RISCV_SET_ULEB128, it must be paired with" > >> - "and applied before R_RISCV_SUB_ULEB128"); > >> + " and applied before R_RISCV_SUB_ULEB128"); > >> r = bfd_reloc_dangerous; > >> } > >> break; > >> @@ -2537,7 +2537,7 @@ riscv_elf_relocate_section (bfd *output_bfd, > >> else > >> { > >> msg = ("Mismatched R_RISCV_SUB_ULEB128, it must be paired with" > >> - "and applied after R_RISCV_SET_ULEB128"); > >> + " and applied after R_RISCV_SET_ULEB128"); > >> r = bfd_reloc_dangerous; > >> } > >> break; > >> -- > >> 2.42.1 > >> > > > > LGTM. Ideally this error message should be tested using `#error:` > > .reloc directive can be used to create a relocation. > > > > .reloc ., R_RISCV_SET_ULEB128, w2 > > Ya, seems reasonable. IIUC there's still some discussion in psABI land > as to exactly what the required semantics of these are, though, so maybe > we hold off on writing tests until things settle down? Yes I am aware of https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/413 whose justification isn't clear. --- In llvm-project, a somewhat common practice is to pre-commit test improvement, and when a change arises, make a commit including both the functional change and the test updates. This makes it clearer how an individual commit changes the behavior and sometimes makes a large patch smaller. Of course in some cases this practice adds some complexity and may not be worth doing. I think the behavior of R_RISCV_SET_ULEB128 is worth checking. The test for this error message seems overdue.
Just inform that this patch is committed. For other discussion about uleb128 overflow checking, we can move to another reply thread and psabi. Nelson On Thu, Dec 7, 2023 at 1:53 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > This was split over multiple lines and ended up missing a space. > > Reported-by: David Abdurachmanov <davidlt@rivosinc.com> > Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> > --- > bfd/elfnn-riscv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c > index 5c4bf4bc3cb..042266e791b 100644 > --- a/bfd/elfnn-riscv.c > +++ b/bfd/elfnn-riscv.c > @@ -2521,7 +2521,7 @@ riscv_elf_relocate_section (bfd *output_bfd, > else > { > msg = ("Mismatched R_RISCV_SET_ULEB128, it must be paired > with" > - "and applied before R_RISCV_SUB_ULEB128"); > + " and applied before R_RISCV_SUB_ULEB128"); > r = bfd_reloc_dangerous; > } > break; > @@ -2537,7 +2537,7 @@ riscv_elf_relocate_section (bfd *output_bfd, > else > { > msg = ("Mismatched R_RISCV_SUB_ULEB128, it must be paired > with" > - "and applied after R_RISCV_SET_ULEB128"); > + " and applied after R_RISCV_SET_ULEB128"); > r = bfd_reloc_dangerous; > } > break; > -- > 2.42.1 > >
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 5c4bf4bc3cb..042266e791b 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -2521,7 +2521,7 @@ riscv_elf_relocate_section (bfd *output_bfd, else { msg = ("Mismatched R_RISCV_SET_ULEB128, it must be paired with" - "and applied before R_RISCV_SUB_ULEB128"); + " and applied before R_RISCV_SUB_ULEB128"); r = bfd_reloc_dangerous; } break; @@ -2537,7 +2537,7 @@ riscv_elf_relocate_section (bfd *output_bfd, else { msg = ("Mismatched R_RISCV_SUB_ULEB128, it must be paired with" - "and applied after R_RISCV_SET_ULEB128"); + " and applied after R_RISCV_SET_ULEB128"); r = bfd_reloc_dangerous; } break;