public inbox for opensbi@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] firmware: Rename __rel_dyn_start/end to __rela_dyn_start/end
@ 2025-07-10  0:29 Jessica Clarke
  2025-07-18  8:01 ` Samuel Holland
  2025-07-21 11:13 ` Anup Patel
  0 siblings, 2 replies; 3+ messages in thread
From: Jessica Clarke @ 2025-07-10  0:29 UTC (permalink / raw)
  To: opensbi; +Cc: Jessica Clarke

We are using and expecting the RELA format, not the REL format, and this
is the conventional linker-generated name for the start/end symbols, so
use it rather than confusing things by making it look like we're
accessing .rel.dyn, which would be in the REL format with no explicit
addend.

Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
---
 firmware/fw_base.S   | 4 ++--
 firmware/fw_base.ldS | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index aa8e264..b675c9e 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -76,8 +76,8 @@ _sc_fail:
 	li	t0, FW_TEXT_START	/* link start */
 	lla	t1, _fw_start		/* load start */
 	sub	t2, t1, t0		/* load offset */
-	lla	t0, __rel_dyn_start
-	lla	t1, __rel_dyn_end
+	lla	t0, __rela_dyn_start
+	lla	t1, __rela_dyn_end
 	beq	t0, t1, _relocate_done
 2:
 	REG_L	t5, __SIZEOF_LONG__(t0)	/* t5 <-- relocation info:type */
diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS
index a33746a..12c7a84 100644
--- a/firmware/fw_base.ldS
+++ b/firmware/fw_base.ldS
@@ -47,9 +47,9 @@
 	. = ALIGN(0x1000); /* Ensure next section is page aligned */
 
 	.rela.dyn : {
-		PROVIDE(__rel_dyn_start = .);
+		PROVIDE(__rela_dyn_start = .);
 		*(.rela*)
-		PROVIDE(__rel_dyn_end = .);
+		PROVIDE(__rela_dyn_end = .);
 	}
 
 	PROVIDE(_rodata_end = .);
-- 
2.34.1


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: Rename __rel_dyn_start/end to __rela_dyn_start/end
  2025-07-10  0:29 [PATCH] firmware: Rename __rel_dyn_start/end to __rela_dyn_start/end Jessica Clarke
@ 2025-07-18  8:01 ` Samuel Holland
  2025-07-21 11:13 ` Anup Patel
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Holland @ 2025-07-18  8:01 UTC (permalink / raw)
  To: Jessica Clarke, opensbi

On 2025-07-09 7:29 PM, Jessica Clarke wrote:
> We are using and expecting the RELA format, not the REL format, and this
> is the conventional linker-generated name for the start/end symbols, so
> use it rather than confusing things by making it look like we're
> accessing .rel.dyn, which would be in the REL format with no explicit
> addend.
> 
> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
> ---
>  firmware/fw_base.S   | 4 ++--
>  firmware/fw_base.ldS | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
Tested-by: Samuel Holland <samuel.holland@sifive.com>


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: Rename __rel_dyn_start/end to __rela_dyn_start/end
  2025-07-10  0:29 [PATCH] firmware: Rename __rel_dyn_start/end to __rela_dyn_start/end Jessica Clarke
  2025-07-18  8:01 ` Samuel Holland
@ 2025-07-21 11:13 ` Anup Patel
  1 sibling, 0 replies; 3+ messages in thread
From: Anup Patel @ 2025-07-21 11:13 UTC (permalink / raw)
  To: Jessica Clarke; +Cc: opensbi

On Thu, Jul 10, 2025 at 6:34 AM Jessica Clarke <jrtc27@jrtc27.com> wrote:
>
> We are using and expecting the RELA format, not the REL format, and this
> is the conventional linker-generated name for the start/end symbols, so
> use it rather than confusing things by making it look like we're
> accessing .rel.dyn, which would be in the REL format with no explicit
> addend.
>
> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  firmware/fw_base.S   | 4 ++--
>  firmware/fw_base.ldS | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/firmware/fw_base.S b/firmware/fw_base.S
> index aa8e264..b675c9e 100644
> --- a/firmware/fw_base.S
> +++ b/firmware/fw_base.S
> @@ -76,8 +76,8 @@ _sc_fail:
>         li      t0, FW_TEXT_START       /* link start */
>         lla     t1, _fw_start           /* load start */
>         sub     t2, t1, t0              /* load offset */
> -       lla     t0, __rel_dyn_start
> -       lla     t1, __rel_dyn_end
> +       lla     t0, __rela_dyn_start
> +       lla     t1, __rela_dyn_end
>         beq     t0, t1, _relocate_done
>  2:
>         REG_L   t5, __SIZEOF_LONG__(t0) /* t5 <-- relocation info:type */
> diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS
> index a33746a..12c7a84 100644
> --- a/firmware/fw_base.ldS
> +++ b/firmware/fw_base.ldS
> @@ -47,9 +47,9 @@
>         . = ALIGN(0x1000); /* Ensure next section is page aligned */
>
>         .rela.dyn : {
> -               PROVIDE(__rel_dyn_start = .);
> +               PROVIDE(__rela_dyn_start = .);
>                 *(.rela*)
> -               PROVIDE(__rel_dyn_end = .);
> +               PROVIDE(__rela_dyn_end = .);
>         }
>
>         PROVIDE(_rodata_end = .);
> --
> 2.34.1
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-21 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10  0:29 [PATCH] firmware: Rename __rel_dyn_start/end to __rela_dyn_start/end Jessica Clarke
2025-07-18  8:01 ` Samuel Holland
2025-07-21 11:13 ` Anup Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox