ARM: linker script: factor out vectors and stubs
authorNicolas Pitre <nicolas.pitre@linaro.org>
Fri, 2 Mar 2018 03:17:03 +0000 (22:17 -0500)
committerNicolas Pitre <nicolas.pitre@linaro.org>
Sat, 10 Mar 2018 01:20:04 +0000 (20:20 -0500)
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 65048708e4c699fc82238978743ccee6dcc89f54..5a50a2a917f577af506f951f1fe3e795c445f764 100644 (file)
@@ -73,26 +73,7 @@ SECTIONS
 
        _etext = .;                     /* End of text and rodata section */
 
-       /*
-        * The vectors and stubs are relocatable code, and the
-        * only thing that matters is their relative offsets
-        */
-       __vectors_start = .;
-       .vectors 0xffff0000 : AT(__vectors_start) {
-               *(.vectors)
-       }
-       . = __vectors_start + SIZEOF(.vectors);
-       __vectors_end = .;
-
-       __stubs_start = .;
-       .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) {
-               *(.stubs)
-       }
-       . = __stubs_start + SIZEOF(.stubs);
-       __stubs_end = .;
-
-       PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));
-
+       ARM_VECTORS
        INIT_TEXT_SECTION(8)
        .exit.text : {
                ARM_EXIT_KEEP(EXIT_TEXT)
index 3b375d8ccb87ba9a7110d37998847ab64373267d..2b893630906164f610d50b025477e553d35da048 100644 (file)
@@ -86,26 +86,7 @@ SECTIONS
 #endif
        __init_begin = .;
 
-       /*
-        * The vectors and stubs are relocatable code, and the
-        * only thing that matters is their relative offsets
-        */
-       __vectors_start = .;
-       .vectors 0xffff0000 : AT(__vectors_start) {
-               *(.vectors)
-       }
-       . = __vectors_start + SIZEOF(.vectors);
-       __vectors_end = .;
-
-       __stubs_start = .;
-       .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) {
-               *(.stubs)
-       }
-       . = __stubs_start + SIZEOF(.stubs);
-       __stubs_end = .;
-
-       PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));
-
+       ARM_VECTORS
        INIT_TEXT_SECTION(8)
        .exit.text : {
                ARM_EXIT_KEEP(EXIT_TEXT)
index 566a7b42a02cfb679b76147b22128ae4d6504906..0a4682ecc4ac246f56043ec688ce8c04fba61011 100644 (file)
                *(.ARM.extab*)                                          \
                __stop_unwind_tab = .;                                  \
        }
+
+/*
+ * The vectors and stubs are relocatable code, and the
+ * only thing that matters is their relative offsets
+ */
+#define ARM_VECTORS                                                    \
+       __vectors_start = .;                                            \
+       .vectors 0xffff0000 : AT(__vectors_start) {                     \
+               *(.vectors)                                             \
+       }                                                               \
+       . = __vectors_start + SIZEOF(.vectors);                         \
+       __vectors_end = .;                                              \
+                                                                       \
+       __stubs_start = .;                                              \
+       .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) {            \
+               *(.stubs)                                               \
+       }                                                               \
+       . = __stubs_start + SIZEOF(.stubs);                             \
+       __stubs_end = .;                                                \
+                                                                       \
+       PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));