Skip to content

Commit 9147095

Browse files
author
Nicolas Pitre
committed
ARM: linker script: factor out vectors and stubs
Signed-off-by: Nicolas Pitre <[email protected]> Tested-by: Chris Brandt <[email protected]>
1 parent d9a46e6 commit 9147095

File tree

3 files changed

+23
-40
lines changed

3 files changed

+23
-40
lines changed

arch/arm/kernel/vmlinux-xip.lds.S

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,7 @@ SECTIONS
7373

7474
_etext = .; /* End of text and rodata section */
7575

76-
/*
77-
* The vectors and stubs are relocatable code, and the
78-
* only thing that matters is their relative offsets
79-
*/
80-
__vectors_start = .;
81-
.vectors 0xffff0000 : AT(__vectors_start) {
82-
*(.vectors)
83-
}
84-
. = __vectors_start + SIZEOF(.vectors);
85-
__vectors_end = .;
86-
87-
__stubs_start = .;
88-
.stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) {
89-
*(.stubs)
90-
}
91-
. = __stubs_start + SIZEOF(.stubs);
92-
__stubs_end = .;
93-
94-
PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));
95-
76+
ARM_VECTORS
9677
INIT_TEXT_SECTION(8)
9778
.exit.text : {
9879
ARM_EXIT_KEEP(EXIT_TEXT)

arch/arm/kernel/vmlinux.lds.S

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,7 @@ SECTIONS
8686
#endif
8787
__init_begin = .;
8888

89-
/*
90-
* The vectors and stubs are relocatable code, and the
91-
* only thing that matters is their relative offsets
92-
*/
93-
__vectors_start = .;
94-
.vectors 0xffff0000 : AT(__vectors_start) {
95-
*(.vectors)
96-
}
97-
. = __vectors_start + SIZEOF(.vectors);
98-
__vectors_end = .;
99-
100-
__stubs_start = .;
101-
.stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) {
102-
*(.stubs)
103-
}
104-
. = __stubs_start + SIZEOF(.stubs);
105-
__stubs_end = .;
106-
107-
PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));
108-
89+
ARM_VECTORS
10990
INIT_TEXT_SECTION(8)
11091
.exit.text : {
11192
ARM_EXIT_KEEP(EXIT_TEXT)

arch/arm/kernel/vmlinux.lds.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,24 @@
9292
*(.ARM.extab*) \
9393
__stop_unwind_tab = .; \
9494
}
95+
96+
/*
97+
* The vectors and stubs are relocatable code, and the
98+
* only thing that matters is their relative offsets
99+
*/
100+
#define ARM_VECTORS \
101+
__vectors_start = .; \
102+
.vectors 0xffff0000 : AT(__vectors_start) { \
103+
*(.vectors) \
104+
} \
105+
. = __vectors_start + SIZEOF(.vectors); \
106+
__vectors_end = .; \
107+
\
108+
__stubs_start = .; \
109+
.stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { \
110+
*(.stubs) \
111+
} \
112+
. = __stubs_start + SIZEOF(.stubs); \
113+
__stubs_end = .; \
114+
\
115+
PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));

0 commit comments

Comments
 (0)