linux-openrisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: ChenMiao <chenmiao.ku@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Linux OpenRISC <linux-openrisc@vger.kernel.org>,
	Jonas Bonn <jonas@southpole.se>,
	Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Subject: Re: [PATCH v4 2/4] openrisc: Add R_OR1K_32_PCREL relocation type module support
Date: Fri, 5 Sep 2025 18:14:06 +0100	[thread overview]
Message-ID: <aLsaXgZCycFI5yid@antec> (raw)
In-Reply-To: <20250904100109.688033-3-chenmiao.ku@gmail.com>

On Thu, Sep 04, 2025 at 10:00:50AM +0000, ChenMiao wrote:
> From: chenmiao <chenmiao.ku@gmail.com>
> 
> To ensure the proper functioning of the jump_label test module, this patch
> adds support for the R_OR1K_32_PCREL relocation type. The implementation
> calculates the PC-relative offset by subtracting the instruction location
> from the target value and stores the result at the specified location.

OK, thanks, really this is needed any modules that use jump_label, not just the
test module.

> Signed-off-by: chenmiao <chenmiao.ku@gmail.com>
> ---
>  arch/openrisc/kernel/module.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/openrisc/kernel/module.c b/arch/openrisc/kernel/module.c
> index c9ff4c4a0b29..4ac4fbaa827c 100644
> --- a/arch/openrisc/kernel/module.c
> +++ b/arch/openrisc/kernel/module.c
> @@ -55,6 +55,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
>  			value |= *location & 0xfc000000;
>  			*location = value;
>  			break;
> +		case R_OR1K_32_PCREL:
> +			value -= (uint32_t)location;
> +			*location = value;
> +			break;
>  		case R_OR1K_AHI16:
>  			/* Adjust the operand to match with a signed LO16.  */
>  			value += 0x8000;
> -- 
> 2.45.2
> 

  reply	other threads:[~2025-09-05 17:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 10:00 [PATCH v4 0/4] openrisc: Support basic trace mechanism ChenMiao
2025-09-04 10:00 ` [PATCH v4 1/4] openrisc: Add text patching API support ChenMiao
2025-09-05 17:15   ` Stafford Horne
2025-09-04 10:00 ` [PATCH v4 2/4] openrisc: Add R_OR1K_32_PCREL relocation type module support ChenMiao
2025-09-05 17:14   ` Stafford Horne [this message]
2025-09-04 10:00 ` [PATCH v4 3/4] openrisc: Regenerate defconfigs ChenMiao
2025-09-05 17:13   ` Stafford Horne
2025-09-04 10:00 ` [PATCH v4 4/4] openrisc: Add jump label support ChenMiao
2025-09-04 10:07   ` Johannes Berg
2025-09-04 10:19     ` Miao Chen
2025-09-05 17:12   ` Stafford Horne
2025-09-05 17:16 ` [PATCH v4 0/4] openrisc: Support basic trace mechanism Stafford Horne
2025-09-05 17:38   ` Chen Miao

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=aLsaXgZCycFI5yid@antec \
    --to=shorne@gmail.com \
    --cc=chenmiao.ku@gmail.com \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=stefan.kristiansson@saunalahti.fi \
    /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 NNTP newsgroup(s).