summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-10-02 16:29:25 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-14 12:09:50 +0200
commitc5d38e92010174f58d733274430ee91f340553b5 (patch)
tree0292e40df43b2e59bd910c11ae68227a79b3d5f8 /arch/x86
parent1bb55ab2d12ebf9be0f9999c3865a658ba928a9e (diff)
downloadbarebox-c5d38e92010174f58d733274430ee91f340553b5.tar.gz
barebox-c5d38e92010174f58d733274430ee91f340553b5.tar.xz
lds: Add and use RO_DATA_SECTION macro
We have many different pointer arrays which we put into linker sections and each time there's one added we have to adjust all linker scripts. This adds a common RO_DATA_SECTION define and uses it for all architectures. This makes it easier to add a new linker array. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/lib/barebox.lds.S31
-rw-r--r--arch/x86/mach-efi/elf_ia32_efi.lds.S9
-rw-r--r--arch/x86/mach-efi/elf_x86_64_efi.lds.S9
3 files changed, 3 insertions, 46 deletions
diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S
index d26f060a3e..71251642dc 100644
--- a/arch/x86/lib/barebox.lds.S
+++ b/arch/x86/lib/barebox.lds.S
@@ -133,6 +133,7 @@ SECTIONS
*(.boot.rodata*)
*(.boot.data*)
. = ALIGN(4);
+ RO_DATA_SECTION
} > barebox
#endif
@@ -164,36 +165,6 @@ SECTIONS
. = ALIGN(4);
} > barebox
- .barebox_cmd : AT ( LOADADDR(.got) + SIZEOF (.got) ) {
- BAREBOX_CMDS
- . = ALIGN(4);
- } > barebox
-
- .barebox_ratp_cmd : AT ( LOADADDR(.got) + SIZEOF (.got) ) {
- BAREBOX_RATP_CMDS
- . = ALIGN(4);
- } > barebox
-
- .barebox_magicvars : AT ( LOADADDR(.barebox_cmd) + SIZEOF (.barebox_cmd) ) {
- BAREBOX_MAGICVARS
- . = ALIGN(4);
- } > barebox
-
- .barebox_initcalls : AT ( LOADADDR(.barebox_magicvars) + SIZEOF (.barebox_magicvars) ) {
- BAREBOX_INITCALLS
- . = ALIGN(4);
- } > barebox
-
- .barebox_exitcalls : AT ( LOADADDR(.barebox_initcalls) + SIZEOF (.barebox_initcalls) ) {
- BAREBOX_EXITCALLS
- . = ALIGN(4);
- } > barebox
-
- .__usymtab : AT ( LOADADDR(.barebox_exitcalls) + SIZEOF (.barebox_exitcalls) ) {
- BAREBOX_SYMS
- . = ALIGN(4);
- } > barebox
-
_edata = .;
.bss : {
__bss_start = .;
diff --git a/arch/x86/mach-efi/elf_ia32_efi.lds.S b/arch/x86/mach-efi/elf_ia32_efi.lds.S
index 70d34f4871..18ddf17802 100644
--- a/arch/x86/mach-efi/elf_ia32_efi.lds.S
+++ b/arch/x86/mach-efi/elf_ia32_efi.lds.S
@@ -35,6 +35,7 @@ SECTIONS
.data : {
*(.rodata*)
+ RO_DATA_SECTION
*(.data)
*(.data1)
*(.data.*)
@@ -50,14 +51,6 @@ SECTIONS
*(COMMON)
}
- . = ALIGN(64);
-
- .barebox_initcalls : { BAREBOX_INITCALLS }
- .barebox_exitcalls : { BAREBOX_EXITCALLS }
- .barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_cmd : { BAREBOX_CMDS }
- __barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
-
. = ALIGN(4096);
.dynamic : { *(.dynamic) }
. = ALIGN(4096);
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 53de22d75c..40a9425034 100644
--- a/arch/x86/mach-efi/elf_x86_64_efi.lds.S
+++ b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
@@ -38,6 +38,7 @@ SECTIONS
.data : {
*(.rodata*)
+ RO_DATA_SECTION
*(.got.plt)
*(.got)
*(.data*)
@@ -52,14 +53,6 @@ SECTIONS
*(.rel.local)
}
- . = ALIGN(64);
-
- .barebox_initcalls : { BAREBOX_INITCALLS }
- .barebox_exitcalls : { BAREBOX_EXITCALLS }
- .barebox_magicvar : { BAREBOX_MAGICVARS }
- __barebox_cmd : { BAREBOX_CMDS }
- __barebox_ratp_cmd : { BAREBOX_RATP_CMDS }
-
. = ALIGN(4096);
.dynamic : { *(.dynamic) }
. = ALIGN(4096);