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 <sjg@chromium.org>
This commit is contained in:
Simon Glass 2025-01-26 11:43:20 -07:00 committed by Tom Rini
parent fe71ebbea9
commit 0741165f3f

View file

@ -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_ */