From 22bdecc9c591ffaca6baaa158012d324c7dfa4da Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 2 Oct 2019 12:47:10 +0200 Subject: 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 Acked-by: Sam Ravnborg --- arch/x86/lib/barebox.lds.S | 16 ++-------------- arch/x86/mach-efi/elf_ia32_efi.lds.S | 15 ++------------- arch/x86/mach-efi/elf_x86_64_efi.lds.S | 15 ++------------- 3 files changed, 6 insertions(+), 40 deletions(-) (limited to 'arch/x86') 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) } -- cgit v1.2.3