From ad92509476ca9c0a675bd484b7dc48ce69cc37fb Mon Sep 17 00:00:00 2001 From: Roberto Vargas Date: Thu, 10 May 2018 11:01:16 +0100 Subject: [PATCH] Add .extab and .exidx sections These sections are required by clang when the code is compiled for aarch32. These sections are related to the unwind of the stack in exceptions, but in the way that clang defines and uses them, the garbage collector cannot get rid of them. Change-Id: I085efc0cf77eae961d522472f72c4b5bad2237ab Signed-off-by: Roberto Vargas --- bl1/bl1.ld.S | 9 +++++++++ bl2/bl2.ld.S | 9 +++++++++ bl2u/bl2u.ld.S | 9 +++++++++ bl32/sp_min/sp_min.ld.S | 9 +++++++++ 4 files changed, 36 insertions(+) diff --git a/bl1/bl1.ld.S b/bl1/bl1.ld.S index 484787d0..fabe3ef6 100644 --- a/bl1/bl1.ld.S +++ b/bl1/bl1.ld.S @@ -32,6 +32,15 @@ SECTIONS __TEXT_END__ = .; } >ROM + /* .ARM.extab and .ARM.exidx are only added because Clang need them */ + .ARM.extab . : { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } >ROM + + .ARM.exidx . : { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >ROM + .rodata . : { __RODATA_START__ = .; *(.rodata*) diff --git a/bl2/bl2.ld.S b/bl2/bl2.ld.S index 5935a64b..6d26cdb2 100644 --- a/bl2/bl2.ld.S +++ b/bl2/bl2.ld.S @@ -32,6 +32,15 @@ SECTIONS __TEXT_END__ = .; } >RAM + /* .ARM.extab and .ARM.exidx are only added because Clang need them */ + .ARM.extab . : { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } >RAM + + .ARM.exidx . : { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >RAM + .rodata . : { __RODATA_START__ = .; *(.rodata*) diff --git a/bl2u/bl2u.ld.S b/bl2u/bl2u.ld.S index d0ffebc3..3db5f894 100644 --- a/bl2u/bl2u.ld.S +++ b/bl2u/bl2u.ld.S @@ -32,6 +32,15 @@ SECTIONS __TEXT_END__ = .; } >RAM + /* .ARM.extab and .ARM.exidx are only added because Clang need them */ + .ARM.extab . : { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } >RAM + + .ARM.exidx . : { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >RAM + .rodata . : { __RODATA_START__ = .; *(.rodata*) diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S index fa3b3acd..ce6c954e 100644 --- a/bl32/sp_min/sp_min.ld.S +++ b/bl32/sp_min/sp_min.ld.S @@ -32,6 +32,15 @@ SECTIONS __TEXT_END__ = .; } >RAM + /* .ARM.extab and .ARM.exidx are only added because Clang need them */ + .ARM.extab . : { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } >RAM + + .ARM.exidx . : { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } >RAM + .rodata . : { __RODATA_START__ = .; *(.rodata*) -- 2.30.2