aboutsummaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorShiji Yang2023-08-03 09:47:16 +0800
committerTom Rini2023-08-09 09:21:42 -0400
commit506df9dc5881b74ca6463b89e9edcd14732a7da5 (patch)
tree3b3fdb9ac6af400dd400c99b47f9c356012588bc /include/asm-generic
parenta077ac13d03c8cde646ddab30b03ec0f8b753e1e (diff)
treewide: rework linker symbol declarations in sections header
1. Convert all linker symbols to char[] type so that we can get the corresponding address by calling array name 'var' or its address '&var'. In this way, we can avoid some potential issues[1]. 2. Remove unused symbol '_TEXT_BASE'. It has been abandoned and has not been referenced by any source code. 3. Move '__data_end' to the arch x86's own sections header as it's only used by x86 arch. 4. Remove some duplicate declared linker symbols. Now we use the standard header file to declare them. [1] This patch fixes the boot failure on MIPS target. Error log: SPL: Image overlaps SPL Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address") Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/sections.h34
1 files changed, 6 insertions, 28 deletions
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 267f1db73f2..1e1657a0167 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -61,8 +61,12 @@ static inline int arch_is_kernel_data(unsigned long addr)
/* Start of U-Boot text region */
extern char __text_start[];
-/* This marks the end of the text region which must be relocated */
-extern char __image_copy_end[];
+/* This marks the text region which must be relocated */
+extern char __image_copy_start[], __image_copy_end[];
+
+extern char __bss_end[];
+extern char __rel_dyn_start[], __rel_dyn_end[];
+extern char _image_binary_end[];
/*
* This is the U-Boot entry point - prior to relocation it should be same
@@ -70,30 +74,4 @@ extern char __image_copy_end[];
*/
extern void _start(void);
-/*
- * ARM defines its symbols as char[]. Other arches define them as ulongs.
- */
-#ifdef CONFIG_ARM
-
-extern char __bss_start[];
-extern char __bss_end[];
-extern char __image_copy_start[];
-extern char __image_copy_end[];
-extern char _image_binary_end[];
-extern char __rel_dyn_start[];
-extern char __rel_dyn_end[];
-
-#else /* don't use offsets: */
-
-/* Exports from the Linker Script */
-extern ulong __data_end;
-extern ulong __rel_dyn_start;
-extern ulong __rel_dyn_end;
-extern ulong __bss_end;
-extern ulong _image_binary_end;
-
-extern ulong _TEXT_BASE; /* code start */
-
-#endif
-
#endif /* _ASM_GENERIC_SECTIONS_H_ */