]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: cpu: armv7m: add ENTRY/ENDPROC macros
authorJohannes Krottmayer <johannes@krotti42.com>
Thu, 8 May 2025 19:00:28 +0000 (19:00 +0000)
committerTom Rini <trini@konsulko.com>
Thu, 22 May 2025 16:57:12 +0000 (10:57 -0600)
Since GNU binutils version 2.44, assembly functions must include
the assembler directive .type name, %function. If not a call to
these functions fails with the error message 'Unknown destination
type (ARM/Thumb)' and the error message 'dangerous relocation:
unsupported relocation' at linking.

The macros ENTRY/ENDPROC includes this directive and should be
used for all assembly functions.

Signed-off-by: Johannes Krottmayer <johannes@krotti42.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/cpu/armv7m/start.S

index 0c07f2140c74a1a07811155c78d6c72ded7c87c4..a439404a248a7e8c9e83152f4f9d24e01d9bbc6c 100644 (file)
@@ -4,13 +4,19 @@
  * Kamil Lulko, <kamil.lulko@gmail.com>
  */
 
+#include <linux/linkage.h>
 #include <asm/assembler.h>
 
-.globl reset
-.type reset, %function
-reset:
-       W(b)    _main
+/*
+ * Startup code (reset vector)
+ */
+ENTRY(reset)
+       W(b)    _main   @ Jump to _main (C runtime crt0.S)
+ENDPROC(reset)
 
-.globl c_runtime_cpu_setup
-c_runtime_cpu_setup:
-       mov     pc, lr
+/*
+ * Setup CPU for C runtime
+ */
+ENTRY(c_runtime_cpu_setup)
+       mov pc, lr                      @ Jump back to caller
+ENDPROC(c_runtime_cpu_setup)