| Message ID | 8243b692-4895-420c-b2d0-27ee3b714732@suse.com |
|---|---|
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 614A14BAD178 for <patchwork@sourceware.org>; Fri, 19 Jun 2026 11:46:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 614A14BAD178 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=L9FasCOo X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id DFD374BA5439 for <binutils@sourceware.org>; Fri, 19 Jun 2026 11:45:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DFD374BA5439 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DFD374BA5439 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781869528; cv=none; b=YtPxmsSPyeN6XeK+nT9Gg89X7y5oIvs6+FWqn+uYNGAvAE7+tLgTGaEZpD2KPeLQPtagMDCEVA8XuJAPB7nB+/D2EQBKZpAaYZyyIEY7MwBRby6WIx0igXxx6vI+l3TqMJ9ZL2s5gmt/GfXj8j3tzAyByUZxuzTO65q7G0phrgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781869528; c=relaxed/simple; bh=/hJIq2fE1GCsIIzRs8MvjQHp9+OkZxTV/MbpSTH418g=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=XJwlmZy6zt/X1WCc50tGn4F9uIIIMBJzTcq0UEJWf6wxfa5Bj/Jm/iJemoA/BuzCU6V6sy5zLRmsTHGOp6bkwy5YDXYkhmWUsMXCBsk+PSeSK9SFcMCa+LsLVWlui5PPhL19BAQm4/B3Ryqt3BtyQjCSTw4vLffrsfbZLX9LQcY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=L9FasCOo DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFD374BA5439 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-490cdae130cso10743855e9.0 for <binutils@sourceware.org>; Fri, 19 Jun 2026 04:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1781869527; x=1782474327; darn=sourceware.org; h=content-transfer-encoding:autocrypt:content-language:cc:to:subject :from:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=/hJIq2fE1GCsIIzRs8MvjQHp9+OkZxTV/MbpSTH418g=; b=L9FasCOo2dLDrAhJjNTG2zRkkkibiYG/0gSatbcNK4BMyrL4auX4YVcW0LUy8JEH/B MC91gh2id9ndOMv0Lgi9AIQ4lBB6N3JCnsqJHUWPrnU8LDlTx+d2AFzZ34OECGyvNzQ+ MlyzgrI+Ot7RG3W6S4GLOndLyXl1TiVmYSikKb6omfW4PbVnBDnRkMtJEbRbJwuDlPRq 74RLLAMBD5KxycajvtHcT330erEq1hYRtbSt0611AUe2+HcqUqX5KFLQ10+FvnyloSih En64cwfACzqm0U7P9hQzjRxeNYVQyflUs0nb9W9F0aAP85J36bgrqQgcM0uo/ZqTWPDJ rllQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781869527; x=1782474327; h=content-transfer-encoding:autocrypt:content-language:cc:to:subject :from:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/hJIq2fE1GCsIIzRs8MvjQHp9+OkZxTV/MbpSTH418g=; b=N87p4Qbil1UJ6aaTjmKK6rJKQzmJXYYXXMoTads6DNJaZjN5+deF33no7BLc5iddca fjFOpKE5KJzPTfdOirUg76UByOSQkn5XL5P9/P0hlTSGh2YzeP0vUkl82k09887EpgnX Oryjsi7HTOEzuGhnOgqslPNRrfO2VhJZVtw3HrEAlqvh0nKroWPPEY/eeHAjLRjiYdUv QmbTZg/QkerN8pMDQZgYpMmNGJzegF0i1Y14Osxuiu3tbFWNcTbiBLqR0pwF4IJ91CFL zePq1aqt19QZiQVSMjODAGFOYJSAjsTQqDb+q01k5P9sTSRm3UDcrETZS90JAWps7XDv Y62A== X-Gm-Message-State: AOJu0YwU2/NU4IbCcHsC3F8gdcrAPFkCDONtTjXY6pc59Oi9k9IlW42q GA/tNmLxfKy94QZY1FkDOICuKvUADgY+2ODjlEoT60v3S0ZWXd9N4tf9oMTBddctelLEqd/7hvN PvXDp4Q== X-Gm-Gg: AfdE7clhCnvhiuxzQ7E/iUWm85liINQHiIucAlEvgcqsEKBMJSIh+u7MUVY5BBrD7Nv vlV39hFHybpBnIBw24CK2RHmF5Qdsp1p9HgRiaSGa7/c3mpONzszSRIgu7xg9+3SQLyyFeTgLph St1LBdWsHCMHmWPiOE2jv7UTYRPFtg+HeZ5HPCB4eli4MXB94kewhFf40s8rZQh15Jq7Ppqthvg kqHHsx3Cusl7EQckIj88ZizNs/NKureKB9ASb5MyWO4OVQwA2N95SOqBbSErKUakK6tBuR2TfCs 7Z8PhF0t9uzCpE3wH0NoyYLUQaqSJRfEc0HWPTfjc3xeNnC9JaffjkuVFe1vimWNcJ4TbxbGBZl GsA71Gu3rZs1a+7feZ6ou3s96QolcWy4/eb2MEACHVx6+HyoxsJD8aXWfKBduwt4u9rlSGQJKV+ ilAM3/U6TK7rv62sY2FdPa/LYipoMBZdMwBX9azng27YyT7NR0BLL51npHtIASqrrvrZ7UjtWjm 0hi X-Received: by 2002:a05:600c:4584:b0:490:4e3e:b483 with SMTP id 5b1f17b1804b1-4923f573129mr58612125e9.22.1781869526825; Fri, 19 Jun 2026 04:45:26 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49246403653sm9052815e9.13.2026.06.19.04.45.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Jun 2026 04:45:26 -0700 (PDT) Message-ID: <8243b692-4895-420c-b2d0-27ee3b714732@suse.com> Date: Fri, 19 Jun 2026 13:45:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jan Beulich <jbeulich@suse.com> Subject: [PATCH v3 00/13] RISC-V: assorted fixes and (hopefully) improvements To: Binutils <binutils@sourceware.org> Cc: Palmer Dabbelt <palmer@dabbelt.com>, Andrew Waterman <andrew@sifive.com>, Jim Wilson <jim.wilson.gcc@gmail.com>, Nelson Chu <nelson.chu1990@gmail.com>, jiawei <jiawei@iscas.ac.cn> Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACr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gkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3016.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@sourceware.org |
| Series |
RISC-V: assorted fixes and (hopefully) improvements
|
|
Message
Jan Beulich
June 19, 2026, 11:45 a.m. UTC
There may not be many dependencies among the patches, but the issues
were all noticed more or less together (i.e. while addressing one,
the next one popped up). I've not made an attempt at sorting the V vs
Z?inx issue, as per Andrew's request.
Quite a few further points are made in remarks in individual patches.
Input there is very welcome.
Jiawei kindly reviewed v1 and v2, and I meanwhile committed a few more
patches from there, which I assumed were pretty sure to be reasonably
uncontroversial. For the others I'd prefer RISC-V maintainer approval,
yet I'm not going to wait indefinitely.
There aren't many changes in v3. See individual changes for what
changed, if anything.
01: RISC-V: add dedicated vector arithmetic .insn forms
02: RISC-V: EEW64 checking
03: bfd/RISC-V: Zvfbfwma implies Zvfbfmin
04: RISC-V: Zv{b,k}* imply Zve32x
05: RISC-V: drop FCVT.Q.L{,U} forms with rounding mode operand
06: RISC-V: make FP rounding mode an optional argument
07: RISC-V: check operands for Zdinx in RV32
08: RISC-V: check operands for Zqinx
09: RISC-V/gas: .attribute vs .insn
10: RISC-V/gas: warn about non-boolean unaligned-access attribute
11: RISC-V/gas: warn about non-power-of-2 stack-align attribute
12: RISC-V/bfd: warn about non-boolean unaligned-access attribute
13: RISC-V/bfd: warn about non-power-of-2 stack-align attribute
I'd also like to point out that [1] continues to be pending. I'm
far from insisting that that patch be taken, but something needs
doing about the issue.
Jan
[1] https://sourceware.org/pipermail/binutils/2023-March/126601.html
Comments
On 2026/6/19 19:45, Jan Beulich wrote:
> [1]https://sourceware.org/pipermail/binutils/2023-March/126601.html
Hi Jan,
I did a more detailed local investigation of this old RFC.
I tested this on current trunk and also on a checkout close to the original
RFC date, around 2023-03-10. The exact numeric altmacro testcase from the
old RFC, using
m1 %v2-v1 17
m2b 81 243
already emits the expected bytes
a2 11
both on current trunk and on the 2023-03-10 checkout I tested. So that
testcase by itself does not demonstrate the issue for me.
However, the underlying problem still seems to exist. A symbolic variant:
.equ s1, 81
.equ s2, 243
m1 %s2-s1 17
fails without the patch with:
% operator needs absolute expression
GDB shows temp_ilp() parsing the string
s2-s1 17
and get_symbol_name() later seeing
s1 17
while input_from_string is true. Since RISC-V currently uses space as
FAKE_LABEL_CHAR, the generic expression parser can treat that space as part
of the symbol-name scan in this mode. That looks like the concrete root
cause.
Rebasing the RFC idea to use ".L0?" / '?' fixes this symbolic testcase. I
also kept the gas/app.c lex[] change from the RFC, so that
FAKE_LABEL_CHAR is
accepted by the scrubber as part of generated/internal symbol names when
needed. In my tests this did not make ordinary unquoted '?' symbols
accepted:
"user?symbol:" was still rejected, while quoted user symbols such as
"user?symbol" remained visible. So '?' looks like a reasonable replacement:
it is not a whitespace separator like the current space character, and I did
not see it introduce broad user-symbol parsing or hiding regressions in the
cases I tested.
I also think the gas/write.h comment update is still useful. The old RISC-V
choice of a space character shows that FAKE_LABEL_CHAR should not merely be
distinct from normal symbol characters; it also should not be a separator or
an operator-start character.
I rebuilt all-gas/all-binutils and ran:
make check-gas RUNTEST=... RUNTESTFLAGS="gas/all/gas.exp=altmacro"
# of expected passes 112
# of expected failures 8
# of unsupported tests 2
make check-gas RUNTEST=... RUNTESTFLAGS="riscv.exp"
# of expected passes 350
For the RISC-V tests I had to update the expected fake label spelling in
la-variants.d from ".L0 " to".L0?".
I would not revive the old patch exactly as-is, though. New objdump should
also hide old-style ".L0 " fake labels for old gas / new objdump
compatibility; otherwise objdump -dr can show labels such as:
0000000000000004 <.L0 >:
The reverse direction, new gas with old objdump, still exposes ".L0?", but I
do not think that can be fixed from the new sources.
One more thing I noticed is that even with patched gas and patched objdump,
objdump -dr can still print fake labels in relocation annotations, for
example:
R_RISCV_PCREL_LO12_I .L0?
This path seems to bypass riscv_symbol_is_valid(). I think this should be
discussed as a separate objdump issue rather than hidden inside the
FAKE_LABEL_CHAR change, especially since these fake labels also help
show the
PCREL HI/LO pairing.
Regarding the other points you raised, I agree that
make_internal_label() using
the same FAKE_LABEL_NAME for all instances is not ideal. It makes relocation
output harder to associate with the specific generated label. But I think
renaming those internal labels to follow the fb_label_name() /
dollar_label_name()
style is a separate cleanup from changing the fake-label character.
For LOCAL_LABEL_CHAR / DOLLAR_LABEL_CHAR handling in read_symbol_name() /
get_symbol_name(), I do not have a concrete failing case yet, so I would
prefer
not to mix that into this change.
I also tested quoted symbols containing '?'. Quoted user symbols such as
"user?symbol" remained visible, and unquoted "user?symbol:" was still
rejected. Symbols like ".Luser?" are still subject to the existing generic
.L local-symbol filtering, but I did not see a new broad false-hiding or
symbol-lexing regression caused by using '?' as FAKE_LABEL_CHAR.
So my recommendation is:
*
use '?' rather than space for the RISC-V fake label character;
*
keep the gas/app.c lex[] handling from the RFC;
*
keep the gas/write.h constraint clarification;
*
add a stronger symbolic altmacro testcase, such as "%s2-s1 17";
*
add compatibility in the RISC-V objdump symbol-valid hook so new objdump
hides both ".L0?" and old ".L0 ";
*
leave relocation annotation cleanup, make_internal_label() naming, and
broader LOCAL_LABEL_CHAR / DOLLAR_LABEL_CHAR handling as separate
follow-ups.
Please let me know if I misunderstood any part of the original issue or the
intended fake-label handling.
Best regards,
Jiawei
Nelson, On 19.06.2026 13:45, Jan Beulich wrote: > There may not be many dependencies among the patches, but the issues > were all noticed more or less together (i.e. while addressing one, > the next one popped up). I've not made an attempt at sorting the V vs > Z?inx issue, as per Andrew's request. > > Quite a few further points are made in remarks in individual patches. > Input there is very welcome. > > Jiawei kindly reviewed v1 and v2, and I meanwhile committed a few more > patches from there, which I assumed were pretty sure to be reasonably > uncontroversial. For the others I'd prefer RISC-V maintainer approval, > yet I'm not going to wait indefinitely. > > There aren't many changes in v3. See individual changes for what > changed, if anything. > > 01: RISC-V: add dedicated vector arithmetic .insn forms > 02: RISC-V: EEW64 checking > 03: bfd/RISC-V: Zvfbfwma implies Zvfbfmin > 04: RISC-V: Zv{b,k}* imply Zve32x > 05: RISC-V: drop FCVT.Q.L{,U} forms with rounding mode operand > 06: RISC-V: make FP rounding mode an optional argument > 07: RISC-V: check operands for Zdinx in RV32 > 08: RISC-V: check operands for Zqinx > 09: RISC-V/gas: .attribute vs .insn > 10: RISC-V/gas: warn about non-boolean unaligned-access attribute > 11: RISC-V/gas: warn about non-power-of-2 stack-align attribute > 12: RISC-V/bfd: warn about non-boolean unaligned-access attribute > 13: RISC-V/bfd: warn about non-power-of-2 stack-align attribute now that you're back, would you mind looking over this series. After branching for 2.47 I'd like to get this in, as I think I have already waited for rather too long. Thanks, Jan > I'd also like to point out that [1] continues to be pending. I'm > far from insisting that that patch be taken, but something needs > doing about the issue. > > Jan > > [1] https://sourceware.org/pipermail/binutils/2023-March/126601.html
Thanks for the information! I would love to take a look at these cool stuffs. Sorry to keep you waiting so long... I remember that 2.47 is scheduled for release in August, so I will have it finished by then. Thanks! Nelson On Thu, Jul 9, 2026 at 1:57 PM Jan Beulich <jbeulich@suse.com> wrote: > Nelson, > > On 19.06.2026 13:45, Jan Beulich wrote: > > There may not be many dependencies among the patches, but the issues > > were all noticed more or less together (i.e. while addressing one, > > the next one popped up). I've not made an attempt at sorting the V vs > > Z?inx issue, as per Andrew's request. > > > > Quite a few further points are made in remarks in individual patches. > > Input there is very welcome. > > > > Jiawei kindly reviewed v1 and v2, and I meanwhile committed a few more > > patches from there, which I assumed were pretty sure to be reasonably > > uncontroversial. For the others I'd prefer RISC-V maintainer approval, > > yet I'm not going to wait indefinitely. > > > > There aren't many changes in v3. See individual changes for what > > changed, if anything. > > > > 01: RISC-V: add dedicated vector arithmetic .insn forms > > 02: RISC-V: EEW64 checking > > 03: bfd/RISC-V: Zvfbfwma implies Zvfbfmin > > 04: RISC-V: Zv{b,k}* imply Zve32x > > 05: RISC-V: drop FCVT.Q.L{,U} forms with rounding mode operand > > 06: RISC-V: make FP rounding mode an optional argument > > 07: RISC-V: check operands for Zdinx in RV32 > > 08: RISC-V: check operands for Zqinx > > 09: RISC-V/gas: .attribute vs .insn > > 10: RISC-V/gas: warn about non-boolean unaligned-access attribute > > 11: RISC-V/gas: warn about non-power-of-2 stack-align attribute > > 12: RISC-V/bfd: warn about non-boolean unaligned-access attribute > > 13: RISC-V/bfd: warn about non-power-of-2 stack-align attribute > > now that you're back, would you mind looking over this series. After > branching for 2.47 I'd like to get this in, as I think I have already > waited for rather too long. > > Thanks, Jan > > > I'd also like to point out that [1] continues to be pending. I'm > > far from insisting that that patch be taken, but something needs > > doing about the issue. > > > > Jan > > > > [1] https://sourceware.org/pipermail/binutils/2023-March/126601.html > >