* ARM - Linking issue with binutils 2.44 (dangerous relocation: unsupported relocation)
@ 2025-05-04 15:12 Johannes Krottmayer
2025-05-05 20:07 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Krottmayer @ 2025-05-04 15:12 UTC (permalink / raw)
To: u-boot
Hello U-Boot list members!
There exist an issue with the newly GNU binutils version 2.44 when
trying to build U-Boot at link time.
Error output:
$ make stm32h743-eval_defconfig
$ make
[...]
LD u-boot
arm-none-eabi-ld.bfd: warning: -z norelro ignored
arm-none-eabi-ld.bfd: arch/arm/cpu/armv7m/start.o(c_runtime_cpu_setup):
Unknown destination type (ARM/Thumb) in arch/arm/lib/crt0.o
arch/arm/lib/crt0.o: in function `_main':
/home/jk/Projects/U-Boot/src/arch/arm/lib/crt0.S:170:(.text+0x44):
dangerous relocation: unsupported relocation
make[1]: *** [/home/jk/Projects/U-Boot/src/Makefile:1824: u-boot] Error 1
make[1]: Leaving directory '/home/jk/Projects/U-Boot/build'
make: *** [Makefile:177: sub-make] Error 2
$
I have tried to fixed it with success. Simply added the assembler
directive ".type c_runtime_cpu_setup, %function" after
".globl c_runtime_cpu_setup". under the path:
arch/arm/cpu/armv7m/start.S
The binutils patch with cause this building error is explained
at least in the following commit in the binutils git repo:
31ed3a9d691493486f6e32357d89a55229dbdc0a
Extract from the log:
"This patch emits an error instead, and warns in some other
cases, to encourage users to add the missing '.type foo,%function'
directive."
But I don't know if this only exist on ARMv7-M.
Kind regards,
Johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ARM - Linking issue with binutils 2.44 (dangerous relocation: unsupported relocation)
2025-05-04 15:12 ARM - Linking issue with binutils 2.44 (dangerous relocation: unsupported relocation) Johannes Krottmayer
@ 2025-05-05 20:07 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2025-05-05 20:07 UTC (permalink / raw)
To: Johannes Krottmayer; +Cc: u-boot
[-- Attachment #1: Type: text/plain, Size: 1631 bytes --]
On Sun, May 04, 2025 at 03:12:07PM +0000, Johannes Krottmayer wrote:
> Hello U-Boot list members!
>
> There exist an issue with the newly GNU binutils version 2.44 when
> trying to build U-Boot at link time.
>
> Error output:
> $ make stm32h743-eval_defconfig
> $ make
> [...]
> LD u-boot
> arm-none-eabi-ld.bfd: warning: -z norelro ignored
> arm-none-eabi-ld.bfd: arch/arm/cpu/armv7m/start.o(c_runtime_cpu_setup):
> Unknown destination type (ARM/Thumb) in arch/arm/lib/crt0.o
> arch/arm/lib/crt0.o: in function `_main':
> /home/jk/Projects/U-Boot/src/arch/arm/lib/crt0.S:170:(.text+0x44):
> dangerous relocation: unsupported relocation
> make[1]: *** [/home/jk/Projects/U-Boot/src/Makefile:1824: u-boot] Error 1
> make[1]: Leaving directory '/home/jk/Projects/U-Boot/build'
> make: *** [Makefile:177: sub-make] Error 2
> $
>
> I have tried to fixed it with success. Simply added the assembler
> directive ".type c_runtime_cpu_setup, %function" after
> ".globl c_runtime_cpu_setup". under the path:
>
> arch/arm/cpu/armv7m/start.S
>
> The binutils patch with cause this building error is explained
> at least in the following commit in the binutils git repo:
> 31ed3a9d691493486f6e32357d89a55229dbdc0a
>
> Extract from the log:
>
> "This patch emits an error instead, and warns in some other
> cases, to encourage users to add the missing '.type foo,%function'
> directive."
>
> But I don't know if this only exist on ARMv7-M.
Thanks for the report. Would you mind submitting a patch to at least fix
that case? It'll help in the future with other reports.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-05 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-04 15:12 ARM - Linking issue with binutils 2.44 (dangerous relocation: unsupported relocation) Johannes Krottmayer
2025-05-05 20:07 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.