[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen: Consolidate linker script setup data



commit 245043bb3a08e9013d87f9bd158f98ae56bd2a9c
Author:     Jason Andryuk <jason.andryuk@xxxxxxx>
AuthorDate: Wed Sep 23 12:19:35 2026 -0400
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Sep 25 14:44:27 2026 +0100

    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 <grygorii_strashko@xxxxxxxx>
    Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
    Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 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(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index d4d9594033..32afbfe131 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -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 = .;
diff --git a/xen/arch/ppc/xen.lds.S b/xen/arch/ppc/xen.lds.S
index d0f2ed43f1..37256c8865 100644
--- a/xen/arch/ppc/xen.lds.S
+++ b/xen/arch/ppc/xen.lds.S
@@ -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)
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 70db658fef..d9375a9616 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -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)
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index b9e888e596..8f943e11ea 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -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)
diff --git a/xen/include/xen/xen.lds.h b/xen/include/xen/xen.lds.h
index ea11e3fb62..958f8256b0 100644
--- a/xen/include/xen/xen.lds.h
+++ b/xen/include/xen/xen.lds.h
@@ -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); \
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.