xen: Consolidate linker script setup data
PATCH 1/1 xen: Consolidate linker script setup data
.init.setup, .initcallpresmp.init, and .initcall1.init are duplicated across architectures. Replace them with a common define, SETUP_DATA.
Suggested-by Grygorii Strashko <[email protected]>
Signed-off-by Jason Andryuk <[email protected]>
Reviewed-by Alejandro Vallejo <[email protected]>
Reviewed-by Jan Beulich <[email protected]>
---
Alejandro reviewed internally.
Jan reviewed off list.
--- xen/arch/arm/xen.lds.S | 11 +---------- xen/arch/ppc/xen.lds.S | 12 +----------- xen/arch/riscv/xen.lds.S | 12 +----------- xen/arch/x86/xen.lds.S | 11 +---------- xen/include/xen/xen.lds.h | 12 ++++++++++++ 5 files changed, 16 insertions(+), 42 deletions(-)
xen/arch/arm/xen.lds.S +1 -10
@@ -135,16 +135,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; + SETUP_DATA . = ALIGN(4); __alt_instructions = .;
xen/arch/ppc/xen.lds.S +1 -11
@@ -107,17 +107,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; - + SETUP_DATA LOCK_PROFILE_DATA *(.init.data)
xen/arch/riscv/xen.lds.S +1 -11
@@ -114,17 +114,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; - + SETUP_DATA LOCK_PROFILE_DATA *(.init.data)
xen/arch/x86/xen.lds.S +1 -10
@@ -223,16 +223,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; + SETUP_DATA *(.init.data) *(.init.data.rel)
xen/include/xen/xen.lds.h +12 -0
@@ -179,6 +179,18 @@ *(.data.schedulers) \ __end_schedulers_array = .; +#define SETUP_DATA \ + . = ALIGN(POINTER_ALIGN); \ + __setup_start = .; \ + *(.init.setup) \ + __setup_end = .; \ + \ + __initcall_start = .; \ + *(.initcallpresmp.init) \ + __presmp_initcall_end = .; \ + *(.initcall1.init) \ + __initcall_end = .; +#ifdef CONFIG_HYPFS #define HYPFS_PARAM \ . = ALIGN(POINTER_ALIGN); \
Signature · 1 line
2.55.0
Quoted 9 lines · Jason Andryuk
.init.setup, .initcallpresmp.init, and .initcall1.init are duplicated across architectures. Replace them with a common define,
SETUP_DATA.Suggested-by Grygorii Strashko <[email protected]>Signed-off-by Jason Andryuk <[email protected]>Reviewed-by Alejandro Vallejo <[email protected]>Reviewed-by Jan Beulich <[email protected]>---
Alejandro reviewed internally.
In case it matters, I confirm.
Cheers,
Alejandro
Quoted 122 lines
Jan reviewed off list.
--- xen/arch/arm/xen.lds.S | 11 +---------- xen/arch/ppc/xen.lds.S | 12 +----------- xen/arch/riscv/xen.lds.S | 12 +----------- xen/arch/x86/xen.lds.S | 11 +---------- xen/include/xen/xen.lds.h | 12 ++++++++++++ 5 files changed, 16 insertions(+), 42 deletions(-)xen/arch/arm/xen.lds.S +1
-10@@ -135,16 +135,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; + SETUP_DATA . = ALIGN(4); __alt_instructions = .;xen/arch/ppc/xen.lds.S +1
-11@@ -107,17 +107,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; - + SETUP_DATA LOCK_PROFILE_DATA *(.init.data)xen/arch/riscv/xen.lds.S +1
-11@@ -114,17 +114,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; - + SETUP_DATA LOCK_PROFILE_DATA *(.init.data)xen/arch/x86/xen.lds.S +1
-10@@ -223,16 +223,7 @@ SECTIONS *(.init.rodata) *(.init.rodata.*) - . = ALIGN(POINTER_ALIGN); - __setup_start = .; - *(.init.setup) - __setup_end = .; - - __initcall_start = .; - *(.initcallpresmp.init) - __presmp_initcall_end = .; - *(.initcall1.init) - __initcall_end = .; + SETUP_DATA *(.init.data) *(.init.data.rel)xen/include/xen/xen.lds.h +12
-0@@ -179,6 +179,18 @@ *(.data.schedulers) \ __end_schedulers_array = .; +#define SETUP_DATA \ + . = ALIGN(POINTER_ALIGN); \ + __setup_start = .; \ + *(.init.setup) \ + __setup_end = .; \ + \ + __initcall_start = .; \ + *(.initcallpresmp.init) \ + __presmp_initcall_end = .; \ + *(.initcall1.init) \ + __initcall_end = .; +#ifdef CONFIG_HYPFS #define HYPFS_PARAM \ . = ALIGN(POINTER_ALIGN); \
Orzel, Michal
Reviewed-byQuoted 8 lines · Alejandro Vallejo
Quoted 7 lines · Jason Andryuk
.init.setup, .initcallpresmp.init, and .initcall1.init are duplicated across architectures. Replace them with a common define,
SETUP_DATA.Suggested-by Grygorii Strashko <[email protected]>Signed-off-by Jason Andryuk <[email protected]>Reviewed-by Alejandro Vallejo <[email protected]>Reviewed-by Jan Beulich <[email protected]>
Reviewed-by Michal Orzel <[email protected]>
~Michal