ARM: linker script: factor out stuff for the .text section
authorNicolas Pitre <nicolas.pitre@linaro.org>
Mon, 5 Mar 2018 21:34:03 +0000 (16:34 -0500)
committerNicolas Pitre <nicolas.pitre@linaro.org>
Sat, 10 Mar 2018 01:19:45 +0000 (20:19 -0500)
Move common entries to vmlinux.lds.h as ARM_TEXT.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Chris Brandt <Chris.Brandt@renesas.com>
arch/arm/kernel/vmlinux-xip.lds.S
arch/arm/kernel/vmlinux.lds.S
arch/arm/kernel/vmlinux.lds.h

index 4bd422966d92f8eda96748c2b89cc8376b4978d5..4ddb547b19b09db2984cd4a87c9806e85b5af8e4 100644 (file)
@@ -53,24 +53,7 @@ SECTIONS
 
        .text : {                       /* Real text segment            */
                _stext = .;             /* Text and read-only data      */
-                       IDMAP_TEXT
-                       __entry_text_start = .;
-                       *(.entry.text)
-                       __entry_text_end = .;
-                       IRQENTRY_TEXT
-                       SOFTIRQENTRY_TEXT
-                       TEXT_TEXT
-                       SCHED_TEXT
-                       CPUIDLE_TEXT
-                       LOCK_TEXT
-                       HYPERVISOR_TEXT
-                       KPROBES_TEXT
-                       *(.gnu.warning)
-                       *(.glue_7)
-                       *(.glue_7t)
-               . = ALIGN(4);
-               *(.got)                 /* Global offset table          */
-                       ARM_CPU_KEEP(PROC_INFO)
+               ARM_TEXT
        }
 
        RO_DATA(PAGE_SIZE)
index b34fbafd543a69d6e12d26768c2cbf383f20e25b..a02a96c651f608ee8d4ca89a3cd0ee3cb9cab893 100644 (file)
@@ -56,24 +56,7 @@ SECTIONS
 
        .text : {                       /* Real text segment            */
                _stext = .;             /* Text and read-only data      */
-                       IDMAP_TEXT
-                       __entry_text_start = .;
-                       *(.entry.text)
-                       __entry_text_end = .;
-                       IRQENTRY_TEXT
-                       SOFTIRQENTRY_TEXT
-                       TEXT_TEXT
-                       SCHED_TEXT
-                       CPUIDLE_TEXT
-                       LOCK_TEXT
-                       HYPERVISOR_TEXT
-                       KPROBES_TEXT
-                       *(.gnu.warning)
-                       *(.glue_7)
-                       *(.glue_7t)
-               . = ALIGN(4);
-               *(.got)                 /* Global offset table          */
-                       ARM_CPU_KEEP(PROC_INFO)
+               ARM_TEXT
        }
 
 #ifdef CONFIG_DEBUG_ALIGN_RODATA
index 1258b66487b22b6c534630461b0981599c28eec6..0ef86d75a0017ce1f35142430798cbe379ecf90e 100644 (file)
                ARM_MMU_DISCARD(*(__ex_table))                          \
                *(.discard)                                             \
                *(.discard.*)
+
+#define ARM_TEXT                                                       \
+               IDMAP_TEXT                                              \
+               __entry_text_start = .;                                 \
+               *(.entry.text)                                          \
+               __entry_text_end = .;                                   \
+               IRQENTRY_TEXT                                           \
+               SOFTIRQENTRY_TEXT                                       \
+               TEXT_TEXT                                               \
+               SCHED_TEXT                                              \
+               CPUIDLE_TEXT                                            \
+               LOCK_TEXT                                               \
+               HYPERVISOR_TEXT                                         \
+               KPROBES_TEXT                                            \
+               *(.gnu.warning)                                         \
+               *(.glue_7)                                              \
+               *(.glue_7t)                                             \
+               . = ALIGN(4);                                           \
+               *(.got)                 /* Global offset table */       \
+               ARM_CPU_KEEP(PROC_INFO)