* [PATCH] ARM: ARM64: linker: Do not put first function at __image_start
@ 2026-05-21 8:06 Sascha Hauer
2026-05-21 8:15 ` Ahmad Fatoum
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2026-05-21 8:06 UTC (permalink / raw)
To: Barebox List
The very first function in the barebox binary starts at __image_start
aka _stext, so resolving its name with %pS results in "__image_start"
instead of the function name. This can be confusing, so add a small
offset to the first function so that its name resolves properly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/lib64/barebox.lds.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S
index bd76a0ca96..1dddd6d1a9 100644
--- a/arch/arm/lib64/barebox.lds.S
+++ b/arch/arm/lib64/barebox.lds.S
@@ -26,6 +26,7 @@ SECTIONS
.text :
{
_stext = .;
+ . += 16;
*(.text*)
} :text
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: ARM64: linker: Do not put first function at __image_start
2026-05-21 8:06 [PATCH] ARM: ARM64: linker: Do not put first function at __image_start Sascha Hauer
@ 2026-05-21 8:15 ` Ahmad Fatoum
0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2026-05-21 8:15 UTC (permalink / raw)
To: Sascha Hauer, Barebox List
Hello Sascha,
On 5/21/26 10:06 AM, Sascha Hauer wrote:
> The very first function in the barebox binary starts at __image_start
> aka _stext, so resolving its name with %pS results in "__image_start"
> instead of the function name. This can be confusing, so add a small
> offset to the first function so that its name resolves properly.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
This patch confused me a bit at first, so I would suggest adding
following clarification to the commit message:
"""
This is safe to do for barebox proper, because it's always an ELF on
ARM64 and thus there is no special significance to code at the start of
the text segment.
"""
Thanks,
Ahmad
> ---
> arch/arm/lib64/barebox.lds.S | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S
> index bd76a0ca96..1dddd6d1a9 100644
> --- a/arch/arm/lib64/barebox.lds.S
> +++ b/arch/arm/lib64/barebox.lds.S
> @@ -26,6 +26,7 @@ SECTIONS
> .text :
> {
> _stext = .;
> + . += 16;
> *(.text*)
> } :text
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-21 10:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-21 8:06 [PATCH] ARM: ARM64: linker: Do not put first function at __image_start Sascha Hauer
2026-05-21 8:15 ` Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox