From 5629b2b11ccbb422847cae776d5faf9bdc5cb5dd Mon Sep 17 00:00:00 2001 From: Roberto Vargas Date: Wed, 11 Apr 2018 11:53:31 +0100 Subject: Use ALIGN instead of NEXT in linker scripts Clang linker doesn't support NEXT. As we are not using the MEMORY command to define discontinuous memory for the output file in any of the linker scripts, ALIGN and NEXT are equivalent. Change-Id: I867ffb9c9a76d4e81c9ca7998280b2edf10efea0 Signed-off-by: Roberto Vargas --- bl32/sp_min/sp_min.ld.S | 8 ++++---- bl32/tsp/tsp.ld.S | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'bl32') diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S index 71de88397..fa3b3acd5 100644 --- a/bl32/sp_min/sp_min.ld.S +++ b/bl32/sp_min/sp_min.ld.S @@ -28,7 +28,7 @@ SECTIONS *entrypoint.o(.text*) *(.text*) *(.vectors) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __TEXT_END__ = .; } >RAM @@ -55,7 +55,7 @@ SECTIONS . = ALIGN(8); #include - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __RODATA_END__ = .; } >RAM #else @@ -92,7 +92,7 @@ SECTIONS * read-only, executable. No RW data from the next section must * creep in. Ensure the rest of the current memory block is unused. */ - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __RO_END__ = .; } >RAM #endif @@ -207,7 +207,7 @@ SECTIONS * as device memory. No other unexpected data must creep in. * Ensure the rest of the current memory page is unused. */ - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __COHERENT_RAM_END__ = .; } >RAM diff --git a/bl32/tsp/tsp.ld.S b/bl32/tsp/tsp.ld.S index 31c5a67e0..97b12ce19 100644 --- a/bl32/tsp/tsp.ld.S +++ b/bl32/tsp/tsp.ld.S @@ -29,14 +29,14 @@ SECTIONS *tsp_entrypoint.o(.text*) *(.text*) *(.vectors) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __TEXT_END__ = .; } >RAM .rodata . : { __RODATA_START__ = .; *(.rodata*) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __RODATA_END__ = .; } >RAM #else @@ -52,7 +52,7 @@ SECTIONS * read-only, executable. No RW data from the next section must * creep in. Ensure the rest of the current memory page is unused. */ - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __RO_END__ = .; } >RAM #endif @@ -117,7 +117,7 @@ SECTIONS * as device memory. No other unexpected data must creep in. * Ensure the rest of the current memory page is unused. */ - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __COHERENT_RAM_END__ = .; } >RAM #endif -- cgit v1.2.3 From ad92509476ca9c0a675bd484b7dc48ce69cc37fb Mon Sep 17 00:00:00 2001 From: Roberto Vargas Date: Thu, 10 May 2018 11:01:16 +0100 Subject: 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 --- bl32/sp_min/sp_min.ld.S | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bl32') diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S index fa3b3acd5..ce6c954ec 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*) -- cgit v1.2.3 From a9203edae7906490faebe0eb91825a0cf9a20783 Mon Sep 17 00:00:00 2001 From: Roberto Vargas Date: Tue, 17 Apr 2018 11:31:43 +0100 Subject: Add end_vector_entry assembler macro Check_vector_size checks if the size of the vector fits in the size reserved for it. This check creates problems in the Clang assembler. A new macro, end_vector_entry, is added and check_vector_size is deprecated. This new macro fills the current exception vector until the next exception vector. If the size of the current vector is bigger than 32 instructions then it gives an error. Change-Id: Ie8545cf1003a1e31656a1018dd6b4c28a4eaf671 Signed-off-by: Roberto Vargas --- bl32/tsp/aarch64/tsp_exceptions.S | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'bl32') diff --git a/bl32/tsp/aarch64/tsp_exceptions.S b/bl32/tsp/aarch64/tsp_exceptions.S index 4b2ad75ee..48e358a3a 100644 --- a/bl32/tsp/aarch64/tsp_exceptions.S +++ b/bl32/tsp/aarch64/tsp_exceptions.S @@ -82,19 +82,19 @@ vector_base tsp_exceptions */ vector_entry sync_exception_sp_el0 b plat_panic_handler - check_vector_size sync_exception_sp_el0 +end_vector_entry sync_exception_sp_el0 vector_entry irq_sp_el0 b plat_panic_handler - check_vector_size irq_sp_el0 +end_vector_entry irq_sp_el0 vector_entry fiq_sp_el0 b plat_panic_handler - check_vector_size fiq_sp_el0 +end_vector_entry fiq_sp_el0 vector_entry serror_sp_el0 b plat_panic_handler - check_vector_size serror_sp_el0 +end_vector_entry serror_sp_el0 /* ----------------------------------------------------- @@ -104,19 +104,19 @@ vector_entry serror_sp_el0 */ vector_entry sync_exception_sp_elx b plat_panic_handler - check_vector_size sync_exception_sp_elx +end_vector_entry sync_exception_sp_elx vector_entry irq_sp_elx handle_tsp_interrupt irq_sp_elx - check_vector_size irq_sp_elx +end_vector_entry irq_sp_elx vector_entry fiq_sp_elx handle_tsp_interrupt fiq_sp_elx - check_vector_size fiq_sp_elx +end_vector_entry fiq_sp_elx vector_entry serror_sp_elx b plat_panic_handler - check_vector_size serror_sp_elx +end_vector_entry serror_sp_elx /* ----------------------------------------------------- @@ -126,19 +126,19 @@ vector_entry serror_sp_elx */ vector_entry sync_exception_aarch64 b plat_panic_handler - check_vector_size sync_exception_aarch64 +end_vector_entry sync_exception_aarch64 vector_entry irq_aarch64 b plat_panic_handler - check_vector_size irq_aarch64 +end_vector_entry irq_aarch64 vector_entry fiq_aarch64 b plat_panic_handler - check_vector_size fiq_aarch64 +end_vector_entry fiq_aarch64 vector_entry serror_aarch64 b plat_panic_handler - check_vector_size serror_aarch64 +end_vector_entry serror_aarch64 /* ----------------------------------------------------- @@ -148,16 +148,16 @@ vector_entry serror_aarch64 */ vector_entry sync_exception_aarch32 b plat_panic_handler - check_vector_size sync_exception_aarch32 +end_vector_entry sync_exception_aarch32 vector_entry irq_aarch32 b plat_panic_handler - check_vector_size irq_aarch32 +end_vector_entry irq_aarch32 vector_entry fiq_aarch32 b plat_panic_handler - check_vector_size fiq_aarch32 +end_vector_entry fiq_aarch32 vector_entry serror_aarch32 b plat_panic_handler - check_vector_size serror_aarch32 +end_vector_entry serror_aarch32 -- cgit v1.2.3