1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

ARM: 8322/1: keep .text and .fixup regions closer together

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>
This commit is contained in:
Ard Biesheuvel 2015-03-24 10:41:09 +01:00 committed by Russell King
parent 779c88c94c
commit c4a84ae39b
11 changed files with 17 additions and 20 deletions

View file

@ -13,7 +13,7 @@
" .align 3\n" \ " .align 3\n" \
" .long 1b, 4f, 2b, 4f\n" \ " .long 1b, 4f, 2b, 4f\n" \
" .popsection\n" \ " .popsection\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"4: mov %0, " err_reg "\n" \ "4: mov %0, " err_reg "\n" \
" b 3b\n" \ " b 3b\n" \

View file

@ -315,7 +315,7 @@ do { \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(ldrb) " %1,[%2],#0\n" \ "1: " TUSER(ldrb) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"3: mov %0, %3\n" \ "3: mov %0, %3\n" \
" mov %1, #0\n" \ " mov %1, #0\n" \
@ -351,7 +351,7 @@ do { \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(ldr) " %1,[%2],#0\n" \ "1: " TUSER(ldr) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"3: mov %0, %3\n" \ "3: mov %0, %3\n" \
" mov %1, #0\n" \ " mov %1, #0\n" \
@ -397,7 +397,7 @@ do { \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(strb) " %1,[%2],#0\n" \ "1: " TUSER(strb) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"3: mov %0, %3\n" \ "3: mov %0, %3\n" \
" b 2b\n" \ " b 2b\n" \
@ -430,7 +430,7 @@ do { \
__asm__ __volatile__( \ __asm__ __volatile__( \
"1: " TUSER(str) " %1,[%2],#0\n" \ "1: " TUSER(str) " %1,[%2],#0\n" \
"2:\n" \ "2:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"3: mov %0, %3\n" \ "3: mov %0, %3\n" \
" b 2b\n" \ " b 2b\n" \
@ -458,7 +458,7 @@ do { \
THUMB( "1: " TUSER(str) " " __reg_oper1 ", [%1]\n" ) \ THUMB( "1: " TUSER(str) " " __reg_oper1 ", [%1]\n" ) \
THUMB( "2: " TUSER(str) " " __reg_oper0 ", [%1, #4]\n" ) \ THUMB( "2: " TUSER(str) " " __reg_oper0 ", [%1, #4]\n" ) \
"3:\n" \ "3:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"4: mov %0, %3\n" \ "4: mov %0, %3\n" \
" b 3b\n" \ " b 3b\n" \

View file

@ -71,7 +71,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
asm( asm(
"1: ldr %0, [%2]\n" "1: ldr %0, [%2]\n"
"2:\n" "2:\n"
" .pushsection .fixup,\"ax\"\n" " .pushsection .text.fixup,\"ax\"\n"
" .align 2\n" " .align 2\n"
"3: and %1, %2, #0x3\n" "3: and %1, %2, #0x3\n"
" bic %2, %2, #0x3\n" " bic %2, %2, #0x3\n"

View file

@ -545,7 +545,7 @@ ENDPROC(__und_usr)
/* /*
* The out of line fixup for the ldrt instructions above. * The out of line fixup for the ldrt instructions above.
*/ */
.pushsection .fixup, "ax" .pushsection .text.fixup, "ax"
.align 2 .align 2
4: str r4, [sp, #S_PC] @ retry current instruction 4: str r4, [sp, #S_PC] @ retry current instruction
ret r9 ret r9

View file

@ -42,7 +42,7 @@
" cmp %0, #0\n" \ " cmp %0, #0\n" \
" movne %0, %4\n" \ " movne %0, %4\n" \
"2:\n" \ "2:\n" \
" .section .fixup,\"ax\"\n" \ " .section .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"3: mov %0, %5\n" \ "3: mov %0, %5\n" \
" b 2b\n" \ " b 2b\n" \

View file

@ -74,7 +74,7 @@ SECTIONS
ARM_EXIT_DISCARD(EXIT_DATA) ARM_EXIT_DISCARD(EXIT_DATA)
EXIT_CALL EXIT_CALL
#ifndef CONFIG_MMU #ifndef CONFIG_MMU
*(.fixup) *(.text.fixup)
*(__ex_table) *(__ex_table)
#endif #endif
#ifndef CONFIG_SMP_ON_UP #ifndef CONFIG_SMP_ON_UP
@ -109,9 +109,6 @@ SECTIONS
SCHED_TEXT SCHED_TEXT
LOCK_TEXT LOCK_TEXT
KPROBES_TEXT KPROBES_TEXT
#ifdef CONFIG_MMU
*(.fixup)
#endif
*(.gnu.warning) *(.gnu.warning)
*(.glue_7) *(.glue_7)
*(.glue_7t) *(.glue_7t)

View file

@ -47,7 +47,7 @@ USER( strnebt r2, [r0])
ENDPROC(__clear_user) ENDPROC(__clear_user)
ENDPROC(__clear_user_std) ENDPROC(__clear_user_std)
.pushsection .fixup,"ax" .pushsection .text.fixup,"ax"
.align 0 .align 0
9001: ldmfd sp!, {r0, pc} 9001: ldmfd sp!, {r0, pc}
.popsection .popsection

View file

@ -100,7 +100,7 @@ WEAK(__copy_to_user)
ENDPROC(__copy_to_user) ENDPROC(__copy_to_user)
ENDPROC(__copy_to_user_std) ENDPROC(__copy_to_user_std)
.pushsection .fixup,"ax" .pushsection .text.fixup,"ax"
.align 0 .align 0
copy_abort_preamble copy_abort_preamble
ldmfd sp!, {r1, r2, r3} ldmfd sp!, {r1, r2, r3}

View file

@ -68,7 +68,7 @@
* so properly, we would have to add in whatever registers were loaded before * so properly, we would have to add in whatever registers were loaded before
* the fault, which, with the current asm above is not predictable. * the fault, which, with the current asm above is not predictable.
*/ */
.pushsection .fixup,"ax" .pushsection .text.fixup,"ax"
.align 4 .align 4
9001: mov r4, #-EFAULT 9001: mov r4, #-EFAULT
ldr r5, [sp, #8*4] @ *err_ptr ldr r5, [sp, #8*4] @ *err_ptr

View file

@ -201,7 +201,7 @@ union offset_union {
THUMB( "1: "ins" %1, [%2]\n" ) \ THUMB( "1: "ins" %1, [%2]\n" ) \
THUMB( " add %2, %2, #1\n" ) \ THUMB( " add %2, %2, #1\n" ) \
"2:\n" \ "2:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"3: mov %0, #1\n" \ "3: mov %0, #1\n" \
" b 2b\n" \ " b 2b\n" \
@ -261,7 +261,7 @@ union offset_union {
" mov %1, %1, "NEXT_BYTE"\n" \ " mov %1, %1, "NEXT_BYTE"\n" \
"2: "ins" %1, [%2]\n" \ "2: "ins" %1, [%2]\n" \
"3:\n" \ "3:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"4: mov %0, #1\n" \ "4: mov %0, #1\n" \
" b 3b\n" \ " b 3b\n" \
@ -301,7 +301,7 @@ union offset_union {
" mov %1, %1, "NEXT_BYTE"\n" \ " mov %1, %1, "NEXT_BYTE"\n" \
"4: "ins" %1, [%2]\n" \ "4: "ins" %1, [%2]\n" \
"5:\n" \ "5:\n" \
" .pushsection .fixup,\"ax\"\n" \ " .pushsection .text.fixup,\"ax\"\n" \
" .align 2\n" \ " .align 2\n" \
"6: mov %0, #1\n" \ "6: mov %0, #1\n" \
" b 5b\n" \ " b 5b\n" \

View file

@ -113,7 +113,7 @@ next:
@ to fault. Emit the appropriate exception gunk to fix things up. @ to fault. Emit the appropriate exception gunk to fix things up.
@ ??? For some reason, faults can happen at .Lx2 even with a @ ??? For some reason, faults can happen at .Lx2 even with a
@ plain LDR instruction. Weird, but it seems harmless. @ plain LDR instruction. Weird, but it seems harmless.
.pushsection .fixup,"ax" .pushsection .text.fixup,"ax"
.align 2 .align 2
.Lfix: ret r9 @ let the user eat segfaults .Lfix: ret r9 @ let the user eat segfaults
.popsection .popsection