Skip to content

Commit 3c83567

Browse files
dhowellsLinus Torvalds
authored andcommitted
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>
1 parent 9e6c1e6 commit 3c83567

4 files changed

Lines changed: 18 additions & 15 deletions

File tree

‎arch/frv/kernel/break.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ __break_trace_through_exceptions:
6363
# entry point for Break Exceptions/Interrupts
6464
#
6565
###############################################################################
66-
.text
66+
.section .text.break
6767
.balign 4
6868
.globl __entry_break
6969
__entry_break:

‎arch/frv/kernel/entry.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#define nr_syscalls ((syscall_table_size)/4)
4040

41-
.text
41+
.section .text.entry
4242
.balign 4
4343

4444
.macro LEDS val

‎arch/frv/kernel/vmlinux.lds.S‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ SECTIONS
7676
*(.data.init_task)
7777
}
7878

79+
. = ALIGN(4096);
80+
.data.page_aligned : { *(.data.idt) }
81+
82+
. = ALIGN(L1_CACHE_BYTES);
83+
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
84+
7985
.trap : {
8086
/* trap table management - read entry-table.S before modifying */
8187
. = ALIGN(8192);
@@ -86,28 +92,25 @@ SECTIONS
8692
*(.trap.break)
8793
}
8894

89-
. = ALIGN(4096);
90-
.data.page_aligned : { *(.data.idt) }
91-
92-
. = ALIGN(L1_CACHE_BYTES);
93-
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
94-
9595
/* Text and read-only data */
9696
. = ALIGN(4);
9797
_text = .;
9898
_stext = .;
9999
.text : {
100-
*(
101-
.text.start .text.*
100+
*(.text.start)
101+
*(.text.entry)
102+
*(.text.break)
103+
*(.text.tlbmiss)
104+
TEXT_TEXT
105+
SCHED_TEXT
106+
LOCK_TEXT
102107
#ifdef CONFIG_DEBUG_INFO
108+
*(
103109
.init.text
104110
.exit.text
105111
.exitcall.exit
106-
#endif
107112
)
108-
TEXT_TEXT
109-
SCHED_TEXT
110-
LOCK_TEXT
113+
#endif
111114
*(.fixup)
112115
*(.gnu.warning)
113116
*(.exitcall.exit)

‎arch/frv/mm/tlb-miss.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <asm/highmem.h>
1717
#include <asm/spr-regs.h>
1818

19-
.section .text
19+
.section .text.tlbmiss
2020
.balign 4
2121

2222
.globl __entry_insn_mmu_miss

0 commit comments

Comments
 (0)