public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "funanzeng at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/106338] New: RISC-V static-chain register may be clobbered by PLT stubs
Date: Mon, 18 Jul 2022 08:00:40 +0000	[thread overview]
Message-ID: <bug-106338-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106338

            Bug ID: 106338
           Summary: RISC-V static-chain register may be clobbered by PLT
                    stubs
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: funanzeng at gmail dot com
  Target Milestone: ---

In commit 09cae7507d9e88f2b05cf3a9404bf181e65ccbac, Palmer ported GCC to RISC-V
and t2 were chosen as the static chain register. However, when I supporting
this feature in LLVM(https://reviews.llvm.org/D129106), jrtc27 pointed out that
this issue.

In practice, static chain parameters are only used in Go and is always used
with closures, where the function pointer is already resolved. As a result,
this issue may not be triggered unless a user directly calls a foreign function
with a static chain parameter, and thus has not caused any problem.

FYI, in a recent change to the RISC-V ABI, STO_RISCV_VARIANT_CC was added to
support unknown ABI.

             reply	other threads:[~2022-07-18  8:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  8:00 funanzeng at gmail dot com [this message]
2022-07-18  8:12 ` [Bug target/106338] " pinskia at gcc dot gnu.org
2022-07-18  8:13 ` pinskia at gcc dot gnu.org
2022-07-18  8:17 ` schwab@linux-m68k.org
2022-08-09 19:47 ` pinskia at gcc dot gnu.org
2022-08-09 21:11 ` andrew at sifive dot com
2022-08-10  2:58 ` kito at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106338-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).