Skip to content

Commit

Permalink
arch: arm: aarch64: linker.ld: move vector table to text segment
Browse files Browse the repository at this point in the history
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 <linker_relocate.ld>
  as CONFIG_CODE_DATA_RELOCATION is not defined for aarch64
  currently (add later if needed).

Fixes: zephyrproject-rtos#22673
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
  • Loading branch information
Abhishek-brcm committed Feb 20, 2020
1 parent 933fdcb commit 8e92de5
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions include/arch/arm/aarch64/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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 <linker_relocate.ld>

#endif /* CONFIG_CODE_DATA_RELOCATION */

SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
{
_image_text_start = .;
*(.text)
*(".text.*")
*(.gnu.linkonce.t.*)
Expand Down Expand Up @@ -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.*)
Expand Down

0 comments on commit 8e92de5

Please sign in to comment.