Skip to content

Commit 8d9d651

Browse files
author
Russell King (Oracle)
committed
ARM: use LOADADDR() to get load address of sections
Use the linker's LOADADDR() macro to get the load address of the sections, and provide a macro to set the start and end symbols. Acked-by: Catalin Marinas <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 04e91b7 commit 8d9d651

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

arch/arm/include/asm/vmlinux.lds.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
#define ARM_MMU_DISCARD(x) x
2727
#endif
2828

29+
/* Set start/end symbol names to the LMA for the section */
30+
#define ARM_LMA(sym, section) \
31+
sym##_start = LOADADDR(section); \
32+
sym##_end = LOADADDR(section) + SIZEOF(section)
33+
2934
#define PROC_INFO \
3035
. = ALIGN(4); \
3136
__proc_info_begin = .; \
@@ -110,19 +115,19 @@
110115
* only thing that matters is their relative offsets
111116
*/
112117
#define ARM_VECTORS \
113-
__vectors_start = .; \
118+
__vectors_lma = .; \
114119
.vectors 0xffff0000 : AT(__vectors_start) { \
115120
*(.vectors) \
116121
} \
117-
. = __vectors_start + SIZEOF(.vectors); \
118-
__vectors_end = .; \
122+
ARM_LMA(__vectors, .vectors); \
123+
. = __vectors_lma + SIZEOF(.vectors); \
119124
\
120-
__stubs_start = .; \
121-
.stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { \
125+
__stubs_lma = .; \
126+
.stubs ADDR(.vectors) + 0x1000 : AT(__stubs_lma) { \
122127
*(.stubs) \
123128
} \
124-
. = __stubs_start + SIZEOF(.stubs); \
125-
__stubs_end = .; \
129+
ARM_LMA(__stubs, .stubs); \
130+
. = __stubs_lma + SIZEOF(.stubs); \
126131
\
127132
PROVIDE(vector_fiq_offset = vector_fiq - ADDR(.vectors));
128133

0 commit comments

Comments
 (0)