ARM - Linking issue with binutils 2.44 (dangerous relocation: unsupported relocation)
Tom Rini
trini at konsulko.com
Mon May 5 22:07:52 CEST 2025
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250505/3ac68db2/attachment.sig>
More information about the U-Boot
mailing list