ARM: 8322/1: keep .text and .fixup regions closer together
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 24 Mar 2015 09:41:09 +0000 (10:41 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 29 Mar 2015 22:11:56 +0000 (23:11 +0100)
This moves all fixup snippets to the .text.fixup section, which is
a special section that gets emitted along with the .text section
for each input object file, i.e., the snippets are kept much closer
to the code they refer to, which helps prevent linker failure on
large kernels.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/futex.h
arch/arm/include/asm/uaccess.h
arch/arm/include/asm/word-at-a-time.h
arch/arm/kernel/entry-armv.S
arch/arm/kernel/swp_emulate.c
arch/arm/kernel/vmlinux.lds.S
arch/arm/lib/clear_user.S
arch/arm/lib/copy_to_user.S
arch/arm/lib/csumpartialcopyuser.S
arch/arm/mm/alignment.c
arch/arm/nwfpe/entry.S

index 53e69da..4e78065 100644 (file)
@@ -13,7 +13,7 @@
        "       .align  3\n"                                    \
        "       .long   1b, 4f, 2b, 4f\n"                       \
        "       .popsection\n"                                  \
-       "       .pushsection .fixup,\"ax\"\n"                   \
+       "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
        "4:     mov     %0, " err_reg "\n"                      \
        "       b       3b\n"                                   \
index ce0786e..74b17d0 100644 (file)
@@ -315,7 +315,7 @@ do {                                                                        \
        __asm__ __volatile__(                                   \
        "1:     " TUSER(ldrb) " %1,[%2],#0\n"                   \
        "2:\n"                                                  \
-       "       .pushsection .fixup,\"ax\"\n"                   \
+       "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
        "3:     mov     %0, %3\n"                               \
        "       mov     %1, #0\n"                               \
@@ -351,7 +351,7 @@ do {                                                                        \
        __asm__ __volatile__(                                   \
        "1:     " TUSER(ldr) "  %1,[%2],#0\n"                   \
        "2:\n"                                                  \
-       "       .pushsection .fixup,\"ax\"\n"                   \
+       "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
        "3:     mov     %0, %3\n"                               \
        "       mov     %1, #0\n"                               \
@@ -397,7 +397,7 @@ do {                                                                        \
        __asm__ __volatile__(                                   \
        "1:     " TUSER(strb) " %1,[%2],#0\n"                   \
        "2:\n"                                                  \
-       "       .pushsection .fixup,\"ax\"\n"                   \
+       "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
        "3:     mov     %0, %3\n"                               \
        "       b       2b\n"                                   \
@@ -430,7 +430,7 @@ do {                                                                        \
        __asm__ __volatile__(                                   \
        "1:     " TUSER(str) "  %1,[%2],#0\n"                   \
        "2:\n"                                                  \
-       "       .pushsection .fixup,\"ax\"\n"                   \
+       "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
        "3:     mov     %0, %3\n"                               \
        "       b       2b\n"                                   \
@@ -458,7 +458,7 @@ do {                                                                        \
  THUMB(        "1:     " TUSER(str) "  " __reg_oper1 ", [%1]\n"        ) \
  THUMB(        "2:     " TUSER(str) "  " __reg_oper0 ", [%1, #4]\n"    ) \
        "3:\n"                                                  \
-       "       .pushsection .fixup,\"ax\"\n"                   \
+       "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
        "4:     mov     %0, %3\n"                               \
        "       b       3b\n"                                   \
index a6d0a29..5831dce 100644 (file)
@@ -71,7 +71,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
        asm(
        "1:     ldr     %0, [%2]\n"
        "2:\n"
-       "       .pushsection .fixup,\"ax\"\n"
+       "       .pushsection .text.fixup,\"ax\"\n"
        "       .align 2\n"
        "3:     and     %1, %2, #0x3\n"
        "       bic     %2, %2, #0x3\n"
index 672b219..570306c 100644 (file)
@@ -545,7 +545,7 @@ ENDPROC(__und_usr)
 /*
  * The out of line fixup for the ldrt instructions above.
  */
-       .pushsection .fixup, "ax"
+       .pushsection .text.fixup, "ax"
        .align  2
 4:     str     r4, [sp, #S_PC]                 @ retry current instruction
        ret     r9
index afdd51e..1361756 100644 (file)
@@ -42,7 +42,7 @@
        "       cmp             %0, #0\n"                       \
        "       movne           %0, %4\n"                       \
        "2:\n"                                                  \
-       "       .section         .fixup,\"ax\"\n"               \
+       "       .section         .text.fixup,\"ax\"\n"          \
        "       .align          2\n"                            \
        "3:     mov             %0, %5\n"                       \
        "       b               2b\n"                           \
index e8d5fba..7a301be 100644 (file)
@@ -74,7 +74,7 @@ SECTIONS
                ARM_EXIT_DISCARD(EXIT_DATA)
                EXIT_CALL
 #ifndef CONFIG_MMU
-               *(.fixup)
+               *(.text.fixup)
                *(__ex_table)
 #endif
 #ifndef CONFIG_SMP_ON_UP
@@ -109,9 +109,6 @@ SECTIONS
                        SCHED_TEXT
                        LOCK_TEXT
                        KPROBES_TEXT
-#ifdef CONFIG_MMU
-                       *(.fixup)
-#endif
                        *(.gnu.warning)
                        *(.glue_7)
                        *(.glue_7t)
index 14a0d98..1710fd7 100644 (file)
@@ -47,7 +47,7 @@ USER(         strnebt r2, [r0])
 ENDPROC(__clear_user)
 ENDPROC(__clear_user_std)
 
-               .pushsection .fixup,"ax"
+               .pushsection .text.fixup,"ax"
                .align  0
 9001:          ldmfd   sp!, {r0, pc}
                .popsection
index a9d3db1..9648b06 100644 (file)
@@ -100,7 +100,7 @@ WEAK(__copy_to_user)
 ENDPROC(__copy_to_user)
 ENDPROC(__copy_to_user_std)
 
-       .pushsection .fixup,"ax"
+       .pushsection .text.fixup,"ax"
        .align 0
        copy_abort_preamble
        ldmfd   sp!, {r1, r2, r3}
index 7d08b43..1d0957e 100644 (file)
@@ -68,7 +68,7 @@
  * so properly, we would have to add in whatever registers were loaded before
  * the fault, which, with the current asm above is not predictable.
  */
-               .pushsection .fixup,"ax"
+               .pushsection .text.fixup,"ax"
                .align  4
 9001:          mov     r4, #-EFAULT
                ldr     r5, [sp, #8*4]          @ *err_ptr
index 2c0c541..9769f1e 100644 (file)
@@ -201,7 +201,7 @@ union offset_union {
  THUMB(        "1:     "ins"   %1, [%2]\n"     )               \
  THUMB(        "       add     %2, %2, #1\n"   )               \
        "2:\n"                                          \
-       "       .pushsection .fixup,\"ax\"\n"           \
+       "       .pushsection .text.fixup,\"ax\"\n"      \
        "       .align  2\n"                            \
        "3:     mov     %0, #1\n"                       \
        "       b       2b\n"                           \
@@ -261,7 +261,7 @@ union offset_union {
                "       mov     %1, %1, "NEXT_BYTE"\n"          \
                "2:     "ins"   %1, [%2]\n"                     \
                "3:\n"                                          \
-               "       .pushsection .fixup,\"ax\"\n"           \
+               "       .pushsection .text.fixup,\"ax\"\n"      \
                "       .align  2\n"                            \
                "4:     mov     %0, #1\n"                       \
                "       b       3b\n"                           \
@@ -301,7 +301,7 @@ union offset_union {
                "       mov     %1, %1, "NEXT_BYTE"\n"          \
                "4:     "ins"   %1, [%2]\n"                     \
                "5:\n"                                          \
-               "       .pushsection .fixup,\"ax\"\n"           \
+               "       .pushsection .text.fixup,\"ax\"\n"      \
                "       .align  2\n"                            \
                "6:     mov     %0, #1\n"                       \
                "       b       5b\n"                           \
index 5d65be1..71df435 100644 (file)
@@ -113,7 +113,7 @@ next:
        @ to fault.  Emit the appropriate exception gunk to fix things up.
        @ ??? For some reason, faults can happen at .Lx2 even with a
        @ plain LDR instruction.  Weird, but it seems harmless.
-       .pushsection .fixup,"ax"
+       .pushsection .text.fixup,"ax"
        .align  2
 .Lfix: ret     r9                      @ let the user eat segfaults
        .popsection