From: Roberto Vargas Date: Wed, 11 Apr 2018 10:53:31 +0000 (+0100) Subject: Use ALIGN instead of NEXT in linker scripts X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=5629b2b11ccbb422847cae776d5faf9bdc5cb5dd;p=project%2Fbcm63xx%2Fatf.git 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 --- diff --git a/bl1/bl1.ld.S b/bl1/bl1.ld.S index 26c0ae4b..484787d0 100644 --- a/bl1/bl1.ld.S +++ b/bl1/bl1.ld.S @@ -28,7 +28,7 @@ SECTIONS *bl1_entrypoint.o(.text*) *(.text*) *(.vectors) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __TEXT_END__ = .; } >ROM @@ -152,7 +152,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 diff --git a/bl2/bl2.ld.S b/bl2/bl2.ld.S index 69c22eb3..5935a64b 100644 --- a/bl2/bl2.ld.S +++ b/bl2/bl2.ld.S @@ -28,7 +28,7 @@ SECTIONS *bl2_entrypoint.o(.text*) *(.text*) *(.vectors) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __TEXT_END__ = .; } >RAM @@ -42,7 +42,7 @@ SECTIONS KEEP(*(.img_parser_lib_descs)) __PARSER_LIB_DESCS_END__ = .; - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __RODATA_END__ = .; } >RAM #else @@ -65,7 +65,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 @@ -131,7 +131,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 diff --git a/bl2/bl2_el3.ld.S b/bl2/bl2_el3.ld.S index 0f91edc9..82ab427d 100644 --- a/bl2/bl2_el3.ld.S +++ b/bl2/bl2_el3.ld.S @@ -42,7 +42,7 @@ SECTIONS __TEXT_RESIDENT_END__ = .; *(.text*) *(.vectors) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __TEXT_END__ = .; #if BL2_IN_XIP_MEM } >ROM @@ -69,7 +69,7 @@ SECTIONS KEEP(*(cpu_ops)) __CPU_OPS_END__ = .; - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __RODATA_END__ = .; #if BL2_IN_XIP_MEM } >ROM @@ -111,7 +111,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__ = .; #if BL2_IN_XIP_MEM @@ -195,7 +195,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 diff --git a/bl2u/bl2u.ld.S b/bl2u/bl2u.ld.S index 7b97758d..d0ffebc3 100644 --- a/bl2u/bl2u.ld.S +++ b/bl2u/bl2u.ld.S @@ -28,14 +28,14 @@ SECTIONS *bl2u_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 @@ -118,7 +118,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 diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S index 59df9b80..66cb3f30 100644 --- a/bl31/bl31.ld.S +++ b/bl31/bl31.ld.S @@ -32,7 +32,7 @@ SECTIONS *bl31_entrypoint.o(.text*) *(.text*) *(.vectors) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __TEXT_END__ = .; } >RAM @@ -67,7 +67,7 @@ SECTIONS . = ALIGN(8); #include - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __RODATA_END__ = .; } >RAM #else @@ -111,7 +111,7 @@ SECTIONS * 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 @@ -131,7 +131,7 @@ SECTIONS spm_shim_exceptions : ALIGN(PAGE_SIZE) { __SPM_SHIM_EXCEPTIONS_START__ = .; *(.spm_shim_exceptions) - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __SPM_SHIM_EXCEPTIONS_END__ = .; } >RAM #endif @@ -246,7 +246,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 diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S index 71de8839..fa3b3acd 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 31c5a67e..97b12ce1 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 diff --git a/include/plat/arm/common/arm_common.ld.S b/include/plat/arm/common/arm_common.ld.S index 6edfa099..3f6e29b0 100644 --- a/include/plat/arm/common/arm_common.ld.S +++ b/include/plat/arm/common/arm_common.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -22,7 +22,7 @@ SECTIONS *(arm_el3_tzc_dram) __EL3_SEC_DRAM_UNALIGNED_END__ = .; - . = NEXT(PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __EL3_SEC_DRAM_END__ = .; } >EL3_SEC_DRAM } diff --git a/plat/mediatek/mt6795/bl31.ld.S b/plat/mediatek/mt6795/bl31.ld.S index 0fbd3f78..8f391df7 100644 --- a/plat/mediatek/mt6795/bl31.ld.S +++ b/plat/mediatek/mt6795/bl31.ld.S @@ -59,7 +59,7 @@ SECTIONS * 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 @@ -161,7 +161,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__ = .; } >RAM2 #endif