Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

FRV: arrange things such that BRA can reach from the trap table

Arrange the sections in the FRV arch so that a BRA instruction with a
16-bit displacement can always reach from the trap table to entry.S,
tlb-miss.S and break.S.

The problem otherwise is that the linker can insert sufficient code between
the slots in the trap table and the targets of the branch instructions in
those slots that the displacement field in the instruction isn't
sufficiently large. This is because the branch targets were in the .text
section along with most of the other code in the kernel.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Howells and committed by
Linus Torvalds
3c835670 9e6c1e63

+20 -17
+1 -1
arch/frv/kernel/break.S
··· 63 63 # entry point for Break Exceptions/Interrupts 64 64 # 65 65 ############################################################################### 66 - .text 66 + .section .text.break 67 67 .balign 4 68 68 .globl __entry_break 69 69 __entry_break:
+1 -1
arch/frv/kernel/entry.S
··· 38 38 39 39 #define nr_syscalls ((syscall_table_size)/4) 40 40 41 - .text 41 + .section .text.entry 42 42 .balign 4 43 43 44 44 .macro LEDS val
+17 -14
arch/frv/kernel/vmlinux.lds.S
··· 76 76 *(.data.init_task) 77 77 } 78 78 79 + . = ALIGN(4096); 80 + .data.page_aligned : { *(.data.idt) } 81 + 82 + . = ALIGN(L1_CACHE_BYTES); 83 + .data.cacheline_aligned : { *(.data.cacheline_aligned) } 84 + 79 85 .trap : { 80 86 /* trap table management - read entry-table.S before modifying */ 81 87 . = ALIGN(8192); ··· 92 86 *(.trap.break) 93 87 } 94 88 95 - . = ALIGN(4096); 96 - .data.page_aligned : { *(.data.idt) } 97 - 98 - . = ALIGN(L1_CACHE_BYTES); 99 - .data.cacheline_aligned : { *(.data.cacheline_aligned) } 100 - 101 89 /* Text and read-only data */ 102 90 . = ALIGN(4); 103 91 _text = .; 104 92 _stext = .; 105 93 .text : { 106 - *( 107 - .text.start .text.* 108 - #ifdef CONFIG_DEBUG_INFO 109 - .init.text 110 - .exit.text 111 - .exitcall.exit 112 - #endif 113 - ) 94 + *(.text.start) 95 + *(.text.entry) 96 + *(.text.break) 97 + *(.text.tlbmiss) 114 98 TEXT_TEXT 115 99 SCHED_TEXT 116 100 LOCK_TEXT 101 + #ifdef CONFIG_DEBUG_INFO 102 + *( 103 + .init.text 104 + .exit.text 105 + .exitcall.exit 106 + ) 107 + #endif 117 108 *(.fixup) 118 109 *(.gnu.warning) 119 110 *(.exitcall.exit)
+1 -1
arch/frv/mm/tlb-miss.S
··· 16 16 #include <asm/highmem.h> 17 17 #include <asm/spr-regs.h> 18 18 19 - .section .text 19 + .section .text.tlbmiss 20 20 .balign 4 21 21 22 22 .globl __entry_insn_mmu_miss