From 35130e73da95371af99734cda3ef8915a6eb5e7a Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Thu, 4 May 2023 12:41:55 +0100 Subject: ld: pru: Place exception-handling sections correctly * scripttempl/pru.sc (OUTPUT_SECTION_ALIGN): New helper variable to place at end of DMEM output sections. (.data): Use the helper variable. (.eh_frame): New output section. (.gnu_extab): Ditto. (.gcc_except_table): Ditto. (.resource_table): Use the helper variable. --- ld/scripttempl/pru.sc | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'ld/scripttempl') diff --git a/ld/scripttempl/pru.sc b/ld/scripttempl/pru.sc index 8531cb8..3ff86bc 100644 --- a/ld/scripttempl/pru.sc +++ b/ld/scripttempl/pru.sc @@ -24,6 +24,12 @@ ENTRY (_start) EOF +OUTPUT_SECTION_ALIGN=" + ${RELOCATING+/* In case this is the last input section, + align to keep the loadable segment size a multiple of the common page size. + Some SoCs have stricter memory size requirements than others. */ + . = ALIGN (CONSTANT (COMMONPAGESIZE));}" + cat < dmem} + + .eh_frame ${RELOCATING-0} : + { + KEEP (*(.eh_frame))${RELOCATING+ *(.eh_frame.*)} + ${OUTPUT_SECTION_ALIGN} + } ${RELOCATING+ > dmem} + + .gnu_extab ${RELOCATING-0} : + { + *(.gnu_extab) + ${OUTPUT_SECTION_ALIGN} + } ${RELOCATING+ > dmem} + + .gcc_except_table ${RELOCATING-0} : + { + *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) + ${OUTPUT_SECTION_ALIGN} } ${RELOCATING+ > dmem} /* Linux remoteproc loader requires the resource_table section @@ -175,10 +196,7 @@ SECTIONS .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN (CONSTANT (MAXPAGESIZE))} : { KEEP (*(.resource_table)) - ${RELOCATING+/* In case this is the last input section, align to - keep the loadable segment size a multiple of the common page size. - Some SoCs have stricter memory size requirements than others. */ - . = ALIGN (CONSTANT (COMMONPAGESIZE));} + ${OUTPUT_SECTION_ALIGN} } ${RELOCATING+ > dmem} /* Global data not cleared after reset. */ -- cgit v1.1