summaryrefslogtreecommitdiffstats
path: root/arch
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 /arch
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 'arch')
-rw-r--r--arch/arm/lib32/barebox.lds.S21
-rw-r--r--arch/arm/lib64/barebox.lds.S21
-rw-r--r--arch/mips/lib/barebox.lds.S21
-rw-r--r--arch/nios2/cpu/barebox.lds.S21
-rw-r--r--arch/openrisc/cpu/barebox.lds.S22
-rw-r--r--arch/ppc/boards/pcm030/barebox.lds.S21
-rw-r--r--arch/ppc/mach-mpc85xx/barebox.lds.S18
-rw-r--r--arch/riscv/lib/barebox.lds.S18
-rw-r--r--arch/sandbox/board/barebox.lds.S14
-rw-r--r--arch/x86/lib/barebox.lds.S16
-rw-r--r--arch/x86/mach-efi/elf_ia32_efi.lds.S15
-rw-r--r--arch/x86/mach-efi/elf_x86_64_efi.lds.S15
12 files changed, 24 insertions, 199 deletions
diff --git a/arch/arm/lib32/barebox.lds.S b/arch/arm/lib32/barebox.lds.S
index 05a50afaad..9ffcffd66d 100644
--- a/arch/arm/lib32/barebox.lds.S
+++ b/arch/arm/lib32/barebox.lds.S
@@ -82,29 +82,12 @@ SECTIONS
.barebox_imd : { BAREBOX_IMD }
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
-
- __barebox_ratp_cmd_start = .;
.barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
-
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
-
- __usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
__usymtab : { BAREBOX_SYMS }
- __usymtab_end = .;
#ifdef CONFIG_PCI
__start_pci_fixups_early = .;
diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S
index 5e9d94bee9..1cc00eca11 100644
--- a/arch/arm/lib64/barebox.lds.S
+++ b/arch/arm/lib64/barebox.lds.S
@@ -64,29 +64,12 @@ SECTIONS
.barebox_imd : { BAREBOX_IMD }
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
-
- __barebox_ratp_cmd_start = .;
.barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
-
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
-
- __usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
__usymtab : { BAREBOX_SYMS }
- __usymtab_end = .;
#ifdef CONFIG_PCI
__start_pci_fixups_early = .;
diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S
index 7109d73372..86a469a042 100644
--- a/arch/mips/lib/barebox.lds.S
+++ b/arch/mips/lib/barebox.lds.S
@@ -41,29 +41,12 @@ SECTIONS
.barebox_imd : { BAREBOX_IMD }
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
-
- __barebox_ratp_cmd_start = .;
.barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
-
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
-
- __usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
__usymtab : { BAREBOX_SYMS }
- __usymtab_end = .;
#ifdef CONFIG_PCI
__start_pci_fixups_early = .;
diff --git a/arch/nios2/cpu/barebox.lds.S b/arch/nios2/cpu/barebox.lds.S
index fbcd1cd3f7..efe8e106a1 100644
--- a/arch/nios2/cpu/barebox.lds.S
+++ b/arch/nios2/cpu/barebox.lds.S
@@ -51,29 +51,12 @@ SECTIONS
.rodata : { *(.rodata) }
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
-
- __barebox_ratp_cmd_start = .;
.barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
-
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
-
- ___usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
__usymtab : { BAREBOX_SYMS }
- ___usymtab_end = .;
_etext = .; /* End of text and rodata section */
diff --git a/arch/openrisc/cpu/barebox.lds.S b/arch/openrisc/cpu/barebox.lds.S
index ed9b90ed70..37242f9c5e 100644
--- a/arch/openrisc/cpu/barebox.lds.S
+++ b/arch/openrisc/cpu/barebox.lds.S
@@ -53,30 +53,12 @@ SECTIONS
. = ALIGN(4);
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS } > ram
- __barebox_cmd_end = .;
-
- __barebox_ratp_cmd_start = .;
.barebox_ratp_cmd : { BAREBOX_RATP_CMDS } > ram
- __barebox_ratp_cmd_end = .;
-
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS } > ram
- __barebox_magicvar_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS } > ram
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS } > ram
- __barebox_exitcalls_end = .;
-
- ___usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS } > ram
+ .barebox_exitcalls : { BAREBOX_EXITCALLS } > ram
__usymtab : { BAREBOX_SYMS } > ram
- ___usymtab_end = .;
-
.dtb : { BAREBOX_DTB } > ram
__etext = .; /* End of text and rodata section */
diff --git a/arch/ppc/boards/pcm030/barebox.lds.S b/arch/ppc/boards/pcm030/barebox.lds.S
index 12b551e685..73e4bde434 100644
--- a/arch/ppc/boards/pcm030/barebox.lds.S
+++ b/arch/ppc/boards/pcm030/barebox.lds.S
@@ -100,29 +100,12 @@ SECTIONS
PROVIDE (edata = .);
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
-
- __barebox_ratp_cmd_start = .;
.barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
-
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
-
- __usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
__usymtab : { BAREBOX_SYMS }
- __usymtab_end = .;
__start___ex_table = .;
__ex_table : { *(__ex_table) }
diff --git a/arch/ppc/mach-mpc85xx/barebox.lds.S b/arch/ppc/mach-mpc85xx/barebox.lds.S
index 30a1c571d7..1874319e71 100644
--- a/arch/ppc/mach-mpc85xx/barebox.lds.S
+++ b/arch/ppc/mach-mpc85xx/barebox.lds.S
@@ -101,25 +101,11 @@ SECTIONS
}
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
-
- __barebox_ratp_cmd_start = .;
.barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
-
- __usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
__usymtab : { BAREBOX_SYMS }
- __usymtab_end = .;
. = .;
__start___ex_table = .;
diff --git a/arch/riscv/lib/barebox.lds.S b/arch/riscv/lib/barebox.lds.S
index 10c19f15de..23e4468e2f 100644
--- a/arch/riscv/lib/barebox.lds.S
+++ b/arch/riscv/lib/barebox.lds.S
@@ -44,25 +44,11 @@ SECTIONS
.got : { *(.got*) }
. = .;
- __barebox_cmd_start = .;
.barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
-
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
-
- __barebox_initcalls_start = .;
- .barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- .barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
-
- __usymtab_start = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
__usymtab : { BAREBOX_SYMS }
- __usymtab_end = .;
.rela.dyn : { *(.rela*) }
diff --git a/arch/sandbox/board/barebox.lds.S b/arch/sandbox/board/barebox.lds.S
index 80e27fe87d..bdce8ecbd6 100644
--- a/arch/sandbox/board/barebox.lds.S
+++ b/arch/sandbox/board/barebox.lds.S
@@ -3,29 +3,19 @@
SECTIONS
{
. = ALIGN(64);
- __barebox_initcalls_start = .;
- __barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
. = ALIGN(64);
- __barebox_exitcalls_start = .;
- __barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
. = ALIGN(64);
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
. = ALIGN(64);
- __barebox_cmd_start = .;
__barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
. = ALIGN(64);
- __barebox_ratp_cmd_start = .;
__barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
}
INSERT BEFORE .rodata;
diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
index 6ee9342f47..d26f060a3e 100644
--- a/arch/x86/lib/barebox.lds.S
+++ b/arch/x86/lib/barebox.lds.S
@@ -165,44 +165,32 @@ SECTIONS
} > barebox
.barebox_cmd : AT ( LOADADDR(.got) + SIZEOF (.got) ) {
- __barebox_cmd_start = .;
BAREBOX_CMDS
- __barebox_cmd_end = .;
. = ALIGN(4);
} > barebox
.barebox_ratp_cmd : AT ( LOADADDR(.got) + SIZEOF (.got) ) {
- __barebox_ratp_cmd_start = .;
BAREBOX_RATP_CMDS
- __barebox_ratp_cmd_end = .;
. = ALIGN(4);
} > barebox
.barebox_magicvars : AT ( LOADADDR(.barebox_cmd) + SIZEOF (.barebox_cmd) ) {
- __barebox_magicvar_start = .;
BAREBOX_MAGICVARS
- __barebox_magicvar_end = .;
. = ALIGN(4);
} > barebox
.barebox_initcalls : AT ( LOADADDR(.barebox_magicvars) + SIZEOF (.barebox_magicvars) ) {
- __barebox_initcalls_start = .;
- INITCALLS
- __barebox_initcalls_end = .;
+ BAREBOX_INITCALLS
. = ALIGN(4);
} > barebox
.barebox_exitcalls : AT ( LOADADDR(.barebox_initcalls) + SIZEOF (.barebox_initcalls) ) {
- __barebox_exitcalls_start = .;
- EXITCALLS
- __barebox_exitcalls_end = .;
+ BAREBOX_EXITCALLS
. = ALIGN(4);
} > barebox
.__usymtab : AT ( LOADADDR(.barebox_exitcalls) + SIZEOF (.barebox_exitcalls) ) {
- __usymtab_start = .;
BAREBOX_SYMS
- __usymtab_end = .;
. = ALIGN(4);
} > barebox
diff --git a/arch/x86/mach-efi/elf_ia32_efi.lds.S b/arch/x86/mach-efi/elf_ia32_efi.lds.S
index 9477aa7d73..a5874c448b 100644
--- a/arch/x86/mach-efi/elf_ia32_efi.lds.S
+++ b/arch/x86/mach-efi/elf_ia32_efi.lds.S
@@ -52,28 +52,17 @@ SECTIONS
. = ALIGN(64);
- __barebox_initcalls_start = .;
- __barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- __barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
. = ALIGN(64);
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
. = ALIGN(64);
- __barebox_cmd_start = .;
__barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
. = ALIGN(64);
- __barebox_ratp_cmd_start = .;
__barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
. = ALIGN(4096);
.dynamic : { *(.dynamic) }
diff --git a/arch/x86/mach-efi/elf_x86_64_efi.lds.S b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
index 90b6b9f3f1..b00cb98c97 100644
--- a/arch/x86/mach-efi/elf_x86_64_efi.lds.S
+++ b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
@@ -54,28 +54,17 @@ SECTIONS
. = ALIGN(64);
- __barebox_initcalls_start = .;
- __barebox_initcalls : { INITCALLS }
- __barebox_initcalls_end = .;
-
- __barebox_exitcalls_start = .;
- __barebox_exitcalls : { EXITCALLS }
- __barebox_exitcalls_end = .;
+ .barebox_initcalls : { BAREBOX_INITCALLS }
+ .barebox_exitcalls : { BAREBOX_EXITCALLS }
. = ALIGN(64);
- __barebox_magicvar_start = .;
.barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_magicvar_end = .;
. = ALIGN(64);
- __barebox_cmd_start = .;
__barebox_cmd : { BAREBOX_CMDS }
- __barebox_cmd_end = .;
. = ALIGN(64);
- __barebox_ratp_cmd_start = .;
__barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
- __barebox_ratp_cmd_end = .;
. = ALIGN(4096);
.dynamic : { *(.dynamic) }