From 6429dd81bfad01cd985a3116113b16105b1206a6 Mon Sep 17 00:00:00 2001 From: Abhishek Shah Date: Fri, 14 Feb 2020 20:38:20 +0530 Subject: [PATCH] arch: arm: aarch64: linker.ld: move vector table to text segment Following changes are done: - The vector table should be placed in text segment. - Removed Vector relay table related entries as it is only applicable to aarch32. - irq_vector_table contains ISR pointers - should be placed in rodata segment. - put openocd_dbg in rodata and skip adding as CONFIG_CODE_DATA_RELOCATION is not defined for aarch64 currently (add later if needed). Fixes: #22673 Signed-off-by: Abhishek Shah --- include/arch/arm/aarch64/scripts/linker.ld | 30 +++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/include/arch/arm/aarch64/scripts/linker.ld b/include/arch/arm/aarch64/scripts/linker.ld index 84eafaabc33..c2ab63887c1 100644 --- a/include/arch/arm/aarch64/scripts/linker.ld +++ b/include/arch/arm/aarch64/scripts/linker.ld @@ -114,39 +114,18 @@ SECTIONS _image_rom_start = ROM_ADDR; - SECTION_PROLOGUE(rom_start,,) + SECTION_PROLOGUE(_TEXT_SECTION_NAME,,) { - -#if defined(CONFIG_SW_VECTOR_RELAY) - KEEP(*(.vector_relay_table)) - KEEP(*(".vector_relay_table.*")) - KEEP(*(.vector_relay_handler)) - KEEP(*(".vector_relay_handler.*")) -#endif + _image_text_start = .; _vector_start = .; KEEP(*(.exc_vector_table)) KEEP(*(".exc_vector_table.*")) - KEEP(*(IRQ_VECTOR_TABLE)) - KEEP(*(.vectors)) _vector_end = .; - KEEP(*(.openocd_dbg)) - KEEP(*(".openocd_dbg.*")) - } GROUP_LINK_IN(ROMABLE_REGION) - -#ifdef CONFIG_CODE_DATA_RELOCATION - -#include - -#endif /* CONFIG_CODE_DATA_RELOCATION */ - - SECTION_PROLOGUE(_TEXT_SECTION_NAME,,) - { - _image_text_start = .; *(.text) *(".text.*") *(.gnu.linkonce.t.*) @@ -195,6 +174,11 @@ SECTIONS SECTION_PROLOGUE(_RODATA_SECTION_NAME,,) { + KEEP(*(IRQ_VECTOR_TABLE)) + + KEEP(*(.openocd_dbg)) + KEEP(*(".openocd_dbg.*")) + *(.rodata) *(".rodata.*") *(.gnu.linkonce.r.*)