summaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-01-26 11:43:20 -0700
committerTom Rini <[email protected]>2025-02-03 16:01:36 -0600
commit0741165f3f2f48dfea8bf3e0472208740c5c2d41 (patch)
treed6c4909bfd6e52dff73876aae1853d4364da52ed /include/asm-generic
parentfe71ebbea96f585daa35f3429cda7b4cf630a33a (diff)
spl: Provide a way to mark code needed for relocation
Add a linker symbol which can be used to mark relocation code, so it can be collected by the linker and copied into a suitable place and executed when needed. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/sections.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index b6bca53db10..3fd5c772a1a 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -67,6 +67,9 @@ extern char __text_start[];
/* This marks the text region which must be relocated */
extern char __image_copy_start[], __image_copy_end[];
+/* This marks the rcode region used for SPL relocation */
+extern char _rcode_start[], _rcode_end[];
+
extern char __bss_end[];
extern char __rel_dyn_start[], __rel_dyn_end[];
extern char _image_binary_end[];
@@ -77,4 +80,17 @@ extern char _image_binary_end[];
*/
extern void _start(void);
+#ifndef USE_HOSTCC
+#if CONFIG_IS_ENABLED(RELOC_LOADER)
+#define __rcode __section(".text.rcode")
+#define __rdata __section(".text.rdata")
+#else
+#define __rcode
+#define __rdata
+#endif
+#else
+#define __rcode
+#define __rdata
+#endif
+
#endif /* _ASM_GENERIC_SECTIONS_H_ */