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 4bd4229..4ddb547 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 b34fbaf..a02a96c 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 1258b66..0ef86d7 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)