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:
@@ -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[];
|
||||
@@ -78,4 +81,17 @@ extern char __dtb[];
|
||||
*/
|
||||
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_ */
|
||||
|
||||
Reference in New Issue
Block a user