summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-10-02 12:47:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-14 12:08:55 +0200
commit22bdecc9c591ffaca6baaa158012d324c7dfa4da (patch)
treeaac3409d887ffa127966d01def08b9ad83cff337 /include
parent99fe1fca690569111d095778b5cc26e7a7160a9e (diff)
downloadbarebox-22bdecc9c591ffaca6baaa158012d324c7dfa4da.tar.gz
barebox-22bdecc9c591ffaca6baaa158012d324c7dfa4da.tar.xz
lds: Move start/end address variables into defines
For the older section defines we specify the start and end addresses outside the macro which means we have to repeat them in each linker script. Make the start/end addresses part of the define to simplify things. While at it, add a BAREBOX_ prefix to the INITCALLS and EXITCALLS macros for consistency to the other defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/barebox.lds.h40
1 files changed, 28 insertions, 12 deletions
diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h
index c9fb8f47ae..0784048eb6 100644
--- a/include/asm-generic/barebox.lds.h
+++ b/include/asm-generic/barebox.lds.h
@@ -16,7 +16,8 @@
#define PRE_IMAGE
#endif
-#define INITCALLS \
+#define BAREBOX_INITCALLS \
+ __barebox_initcalls_start = .; \
KEEP(*(.initcall.0)) \
KEEP(*(.initcall.1)) \
KEEP(*(.initcall.2)) \
@@ -31,24 +32,39 @@
KEEP(*(.initcall.11)) \
KEEP(*(.initcall.12)) \
KEEP(*(.initcall.13)) \
- KEEP(*(.initcall.14))
+ KEEP(*(.initcall.14)) \
+ __barebox_initcalls_end = .;
-#define EXITCALLS \
+#define BAREBOX_EXITCALLS \
+ __barebox_exitcalls_start = .; \
KEEP(*(.exitcall.0)) \
KEEP(*(.exitcall.1)) \
KEEP(*(.exitcall.2)) \
KEEP(*(.exitcall.3)) \
KEEP(*(.exitcall.4)) \
KEEP(*(.exitcall.5)) \
- KEEP(*(.exitcall.6))
-
-#define BAREBOX_CMDS KEEP(*(SORT_BY_NAME(.barebox_cmd*)))
-
-#define BAREBOX_RATP_CMDS KEEP(*(SORT_BY_NAME(.barebox_ratp_cmd*)))
-
-#define BAREBOX_SYMS KEEP(*(__usymtab))
-
-#define BAREBOX_MAGICVARS KEEP(*(SORT_BY_NAME(.barebox_magicvar*)))
+ KEEP(*(.exitcall.6)) \
+ __barebox_exitcalls_end = .;
+
+#define BAREBOX_CMDS \
+ __barebox_cmd_start = .; \
+ KEEP(*(SORT_BY_NAME(.barebox_cmd*))) \
+ __barebox_cmd_end = .;
+
+#define BAREBOX_RATP_CMDS \
+ __barebox_ratp_cmd_start = .; \
+ KEEP(*(SORT_BY_NAME(.barebox_ratp_cmd*))) \
+ __barebox_ratp_cmd_end = .;
+
+#define BAREBOX_SYMS \
+ __usymtab_start = .; \
+ KEEP(*(__usymtab)) \
+ __usymtab_end = .;
+
+#define BAREBOX_MAGICVARS \
+ __barebox_magicvar_start = .; \
+ KEEP(*(SORT_BY_NAME(.barebox_magicvar*))) \
+ __barebox_magicvar_end = .;
#define BAREBOX_CLK_TABLE \
. = ALIGN(8); \