public inbox for
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <>
To: Joseph Faulls <>
Cc: "" <>,
	 "" <>,
	 "" <>
Subject: Re: [PATCH] RISC-V: Do not gp relax against an ABS symbol if it is far away.
Date: Tue, 8 Aug 2023 10:49:23 +0100 (BST)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <LO4P265MB59141A6F1238DFB73BC2A9818001A@LO4P265MB5914.GBRP265.PROD.OUTLOOK.COM>

On Thu, 27 Jul 2023, Joseph Faulls wrote:

> Relaxations can cause the gp to move after it has been decided to gp
> relax. Against an absolute symbol, the distance may change such that the
> offset can no longer fit in the 12-bit immediate field.

 What's the use case for using AUIPC/LW to load an absolute symbol?  Such 
symbols are not used in contexts where an address could alternatively be 
expected, so the correct sequence, and in PIC or PIE code indeed the only 
valid, for direct references from code is LUI/ADDI.  Since you're fiddling 
with linker relaxation code here, you may well take the opportunity and 
relax it to LUI/ADDI, or ADDI alone if the value is small.  There may be 
an issue with RV64 objects if the value turns out outside the 32-bit range 
though, which will be a relocation overflow.


  parent reply	other threads:[~2023-08-08  9:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 16:48 Joseph Faulls
2023-07-27 17:02 ` Andreas Schwab
2023-07-27 21:08 ` Palmer Dabbelt
2023-07-28  1:02   ` Nelson Chu
2023-07-28  1:15     ` Nelson Chu
2023-07-28  9:18       ` [EXTERNAL] " Joseph Faulls
2023-07-28 15:03         ` Palmer Dabbelt
2023-07-28 15:52           ` Joseph Faulls
2023-07-28 16:12             ` Palmer Dabbelt
2023-08-08  9:49 ` Maciej W. Rozycki [this message]
2023-08-08 10:38   ` Joseph Faulls
2023-08-08 12:04     ` Maciej W. Rozycki
2023-08-23 11:16     ` Joseph Faulls

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:

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

  git send-email \ \ \ \ \ \ \

* 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).