xref: /rk3399_ARM-atf/bl31/bl31.ld.S (revision 665e71b8ea28162ec7737c1411bca3ea89e5957e)
14f6ad66aSAchin Gupta/*
2c367b75eSMadhukar Pappireddy * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
34f6ad66aSAchin Gupta *
482cb2c1aSdp-arm * SPDX-License-Identifier: BSD-3-Clause
54f6ad66aSAchin Gupta */
64f6ad66aSAchin Gupta
75f0cdb05SDan Handley#include <platform_def.h>
809d40e0eSAntonio Nino Diaz
9*665e71b8SMasahiro Yamada#include <common/bl_common.ld.h>
1009d40e0eSAntonio Nino Diaz#include <lib/xlat_tables/xlat_tables_defs.h>
114f6ad66aSAchin Gupta
124f6ad66aSAchin GuptaOUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
134f6ad66aSAchin GuptaOUTPUT_ARCH(PLATFORM_LINKER_ARCH)
149f98aa1aSJeenu ViswambharanENTRY(bl31_entrypoint)
154f6ad66aSAchin Gupta
164f6ad66aSAchin Gupta
174f6ad66aSAchin GuptaMEMORY {
18d7fbf132SJuan Castillo    RAM (rwx): ORIGIN = BL31_BASE, LENGTH = BL31_LIMIT - BL31_BASE
19f8578e64SSamuel Holland#if SEPARATE_NOBITS_REGION
20f8578e64SSamuel Holland    NOBITS (rw!a): ORIGIN = BL31_NOBITS_BASE, LENGTH = BL31_NOBITS_LIMIT - BL31_NOBITS_BASE
21f8578e64SSamuel Holland#else
22f8578e64SSamuel Holland#define NOBITS RAM
23f8578e64SSamuel Holland#endif
244f6ad66aSAchin Gupta}
254f6ad66aSAchin Gupta
26ec693569SCaesar Wang#ifdef PLAT_EXTRA_LD_SCRIPT
27ec693569SCaesar Wang#include <plat.ld.S>
28ec693569SCaesar Wang#endif
294f6ad66aSAchin Gupta
304f6ad66aSAchin GuptaSECTIONS
314f6ad66aSAchin Gupta{
324f6ad66aSAchin Gupta    . = BL31_BASE;
33a2aedac2SAntonio Nino Diaz    ASSERT(. == ALIGN(PAGE_SIZE),
348d69a03fSSandrine Bailleux           "BL31_BASE address is not aligned on a page boundary.")
354f6ad66aSAchin Gupta
36931f7c61SSoby Mathew    __BL31_START__ = .;
37931f7c61SSoby Mathew
385d1c104fSSandrine Bailleux#if SEPARATE_CODE_AND_RODATA
395d1c104fSSandrine Bailleux    .text . : {
405d1c104fSSandrine Bailleux        __TEXT_START__ = .;
415d1c104fSSandrine Bailleux        *bl31_entrypoint.o(.text*)
42ebd6efaeSSamuel Holland        *(SORT_BY_ALIGNMENT(.text*))
435d1c104fSSandrine Bailleux        *(.vectors)
445629b2b1SRoberto Vargas        . = ALIGN(PAGE_SIZE);
455d1c104fSSandrine Bailleux        __TEXT_END__ = .;
465d1c104fSSandrine Bailleux    } >RAM
475d1c104fSSandrine Bailleux
485d1c104fSSandrine Bailleux    .rodata . : {
495d1c104fSSandrine Bailleux        __RODATA_START__ = .;
50ebd6efaeSSamuel Holland        *(SORT_BY_ALIGNMENT(.rodata*))
515d1c104fSSandrine Bailleux
525d1c104fSSandrine Bailleux        /* Ensure 8-byte alignment for descriptors and ensure inclusion */
535d1c104fSSandrine Bailleux        . = ALIGN(8);
545d1c104fSSandrine Bailleux        __RT_SVC_DESCS_START__ = .;
555d1c104fSSandrine Bailleux        KEEP(*(rt_svc_descs))
565d1c104fSSandrine Bailleux        __RT_SVC_DESCS_END__ = .;
575d1c104fSSandrine Bailleux
585d1c104fSSandrine Bailleux#if ENABLE_PMF
595d1c104fSSandrine Bailleux        /* Ensure 8-byte alignment for descriptors and ensure inclusion */
605d1c104fSSandrine Bailleux        . = ALIGN(8);
615d1c104fSSandrine Bailleux        __PMF_SVC_DESCS_START__ = .;
625d1c104fSSandrine Bailleux        KEEP(*(pmf_svc_descs))
635d1c104fSSandrine Bailleux        __PMF_SVC_DESCS_END__ = .;
645d1c104fSSandrine Bailleux#endif /* ENABLE_PMF */
655d1c104fSSandrine Bailleux
665d1c104fSSandrine Bailleux        /*
675d1c104fSSandrine Bailleux         * Ensure 8-byte alignment for cpu_ops so that its fields are also
685d1c104fSSandrine Bailleux         * aligned. Also ensure cpu_ops inclusion.
695d1c104fSSandrine Bailleux         */
705d1c104fSSandrine Bailleux        . = ALIGN(8);
715d1c104fSSandrine Bailleux        __CPU_OPS_START__ = .;
725d1c104fSSandrine Bailleux        KEEP(*(cpu_ops))
735d1c104fSSandrine Bailleux        __CPU_OPS_END__ = .;
745d1c104fSSandrine Bailleux
75931f7c61SSoby Mathew        /*
765bfac4fcSSoby Mathew         * Keep the .got section in the RO section as it is patched
77931f7c61SSoby Mathew         * prior to enabling the MMU and having the .got in RO is better for
785bfac4fcSSoby Mathew         * security. GOT is a table of addresses so ensure 8-byte alignment.
79931f7c61SSoby Mathew         */
805bfac4fcSSoby Mathew        . = ALIGN(8);
81931f7c61SSoby Mathew        __GOT_START__ = .;
82931f7c61SSoby Mathew        *(.got)
83931f7c61SSoby Mathew        __GOT_END__ = .;
84931f7c61SSoby Mathew
858e743bcdSJeenu Viswambharan        /* Place pubsub sections for events */
868e743bcdSJeenu Viswambharan        . = ALIGN(8);
8709d40e0eSAntonio Nino Diaz#include <lib/el3_runtime/pubsub_events.h>
888e743bcdSJeenu Viswambharan
895629b2b1SRoberto Vargas        . = ALIGN(PAGE_SIZE);
905d1c104fSSandrine Bailleux        __RODATA_END__ = .;
915d1c104fSSandrine Bailleux    } >RAM
925d1c104fSSandrine Bailleux#else
938d69a03fSSandrine Bailleux    ro . : {
948d69a03fSSandrine Bailleux        __RO_START__ = .;
95dccc537aSAndrew Thoelke        *bl31_entrypoint.o(.text*)
96ebd6efaeSSamuel Holland        *(SORT_BY_ALIGNMENT(.text*))
97ebd6efaeSSamuel Holland        *(SORT_BY_ALIGNMENT(.rodata*))
987421b465SAchin Gupta
99dccc537aSAndrew Thoelke        /* Ensure 8-byte alignment for descriptors and ensure inclusion */
1007421b465SAchin Gupta        . = ALIGN(8);
1017421b465SAchin Gupta        __RT_SVC_DESCS_START__ = .;
102dccc537aSAndrew Thoelke        KEEP(*(rt_svc_descs))
1037421b465SAchin Gupta        __RT_SVC_DESCS_END__ = .;
1047421b465SAchin Gupta
105a31d8983SYatharth Kochar#if ENABLE_PMF
106a31d8983SYatharth Kochar        /* Ensure 8-byte alignment for descriptors and ensure inclusion */
107a31d8983SYatharth Kochar        . = ALIGN(8);
108a31d8983SYatharth Kochar        __PMF_SVC_DESCS_START__ = .;
109a31d8983SYatharth Kochar        KEEP(*(pmf_svc_descs))
110a31d8983SYatharth Kochar        __PMF_SVC_DESCS_END__ = .;
111a31d8983SYatharth Kochar#endif /* ENABLE_PMF */
112a31d8983SYatharth Kochar
1139b476841SSoby Mathew        /*
1149b476841SSoby Mathew         * Ensure 8-byte alignment for cpu_ops so that its fields are also
1159b476841SSoby Mathew         * aligned. Also ensure cpu_ops inclusion.
1169b476841SSoby Mathew         */
1179b476841SSoby Mathew        . = ALIGN(8);
1189b476841SSoby Mathew        __CPU_OPS_START__ = .;
1199b476841SSoby Mathew        KEEP(*(cpu_ops))
1209b476841SSoby Mathew        __CPU_OPS_END__ = .;
1219b476841SSoby Mathew
1225bfac4fcSSoby Mathew        /*
1235bfac4fcSSoby Mathew         * Keep the .got section in the RO section as it is patched
1245bfac4fcSSoby Mathew         * prior to enabling the MMU and having the .got in RO is better for
1255bfac4fcSSoby Mathew         * security. GOT is a table of addresses so ensure 8-byte alignment.
1265bfac4fcSSoby Mathew         */
1275bfac4fcSSoby Mathew        . = ALIGN(8);
1285bfac4fcSSoby Mathew        __GOT_START__ = .;
1295bfac4fcSSoby Mathew        *(.got)
1305bfac4fcSSoby Mathew        __GOT_END__ = .;
1315bfac4fcSSoby Mathew
1328e743bcdSJeenu Viswambharan        /* Place pubsub sections for events */
1338e743bcdSJeenu Viswambharan        . = ALIGN(8);
13409d40e0eSAntonio Nino Diaz#include <lib/el3_runtime/pubsub_events.h>
1358e743bcdSJeenu Viswambharan
136b739f22aSAchin Gupta        *(.vectors)
1378d69a03fSSandrine Bailleux        __RO_END_UNALIGNED__ = .;
1388d69a03fSSandrine Bailleux        /*
1398d69a03fSSandrine Bailleux         * Memory page(s) mapped to this section will be marked as read-only,
1408d69a03fSSandrine Bailleux         * executable.  No RW data from the next section must creep in.
1418d69a03fSSandrine Bailleux         * Ensure the rest of the current memory page is unused.
1428d69a03fSSandrine Bailleux         */
1435629b2b1SRoberto Vargas        . = ALIGN(PAGE_SIZE);
1448d69a03fSSandrine Bailleux        __RO_END__ = .;
1454f6ad66aSAchin Gupta    } >RAM
1465d1c104fSSandrine Bailleux#endif
1474f6ad66aSAchin Gupta
1489b476841SSoby Mathew    ASSERT(__CPU_OPS_END__ > __CPU_OPS_START__,
1499b476841SSoby Mathew           "cpu_ops not defined for this platform.")
1509b476841SSoby Mathew
151538b0020SPaul Beesley#if SPM_MM
15232e83537SArd Biesheuvel#ifndef SPM_SHIM_EXCEPTIONS_VMA
15332e83537SArd Biesheuvel#define SPM_SHIM_EXCEPTIONS_VMA         RAM
15432e83537SArd Biesheuvel#endif
15532e83537SArd Biesheuvel
1562fccb228SAntonio Nino Diaz    /*
1572fccb228SAntonio Nino Diaz     * Exception vectors of the SPM shim layer. They must be aligned to a 2K
1582fccb228SAntonio Nino Diaz     * address, but we need to place them in a separate page so that we can set
1592fccb228SAntonio Nino Diaz     * individual permissions to them, so the actual alignment needed is 4K.
1602fccb228SAntonio Nino Diaz     *
1612fccb228SAntonio Nino Diaz     * There's no need to include this into the RO section of BL31 because it
1622fccb228SAntonio Nino Diaz     * doesn't need to be accessed by BL31.
1632fccb228SAntonio Nino Diaz     */
164a2aedac2SAntonio Nino Diaz    spm_shim_exceptions : ALIGN(PAGE_SIZE) {
1652fccb228SAntonio Nino Diaz        __SPM_SHIM_EXCEPTIONS_START__ = .;
1662fccb228SAntonio Nino Diaz        *(.spm_shim_exceptions)
1675629b2b1SRoberto Vargas        . = ALIGN(PAGE_SIZE);
1682fccb228SAntonio Nino Diaz        __SPM_SHIM_EXCEPTIONS_END__ = .;
16932e83537SArd Biesheuvel    } >SPM_SHIM_EXCEPTIONS_VMA AT>RAM
17032e83537SArd Biesheuvel
17132e83537SArd Biesheuvel    PROVIDE(__SPM_SHIM_EXCEPTIONS_LMA__ = LOADADDR(spm_shim_exceptions));
17232e83537SArd Biesheuvel    . = LOADADDR(spm_shim_exceptions) + SIZEOF(spm_shim_exceptions);
1732fccb228SAntonio Nino Diaz#endif
1742fccb228SAntonio Nino Diaz
17554dc71e7SAchin Gupta    /*
17654dc71e7SAchin Gupta     * Define a linker symbol to mark start of the RW memory area for this
17754dc71e7SAchin Gupta     * image.
17854dc71e7SAchin Gupta     */
17954dc71e7SAchin Gupta    __RW_START__ = . ;
18054dc71e7SAchin Gupta
18151faada7SDouglas Raillard    /*
18251faada7SDouglas Raillard     * .data must be placed at a lower address than the stacks if the stack
18351faada7SDouglas Raillard     * protector is enabled. Alternatively, the .data.stack_protector_canary
18451faada7SDouglas Raillard     * section can be placed independently of the main .data section.
18551faada7SDouglas Raillard     */
1868d69a03fSSandrine Bailleux   .data . : {
1878d69a03fSSandrine Bailleux        __DATA_START__ = .;
188ebd6efaeSSamuel Holland        *(SORT_BY_ALIGNMENT(.data*))
1898d69a03fSSandrine Bailleux        __DATA_END__ = .;
1908d69a03fSSandrine Bailleux    } >RAM
1918d69a03fSSandrine Bailleux
192931f7c61SSoby Mathew    /*
193931f7c61SSoby Mathew     * .rela.dyn needs to come after .data for the read-elf utility to parse
1945bfac4fcSSoby Mathew     * this section correctly. Ensure 8-byte alignment so that the fields of
1955bfac4fcSSoby Mathew     * RELA data structure are aligned.
196931f7c61SSoby Mathew     */
1975bfac4fcSSoby Mathew    . = ALIGN(8);
198931f7c61SSoby Mathew    __RELA_START__ = .;
199931f7c61SSoby Mathew    .rela.dyn . : {
200931f7c61SSoby Mathew    } >RAM
201931f7c61SSoby Mathew    __RELA_END__ = .;
202931f7c61SSoby Mathew
203a1b6db6cSSandrine Bailleux#ifdef BL31_PROGBITS_LIMIT
204d178637dSJuan Castillo    ASSERT(. <= BL31_PROGBITS_LIMIT, "BL31 progbits has exceeded its limit.")
205a1b6db6cSSandrine Bailleux#endif
206a1b6db6cSSandrine Bailleux
207f8578e64SSamuel Holland#if SEPARATE_NOBITS_REGION
208f8578e64SSamuel Holland    /*
209f8578e64SSamuel Holland     * Define a linker symbol to mark end of the RW memory area for this
210f8578e64SSamuel Holland     * image.
211f8578e64SSamuel Holland     */
212c367b75eSMadhukar Pappireddy    . = ALIGN(PAGE_SIZE);
213f8578e64SSamuel Holland    __RW_END__ = .;
214f8578e64SSamuel Holland    __BL31_END__ = .;
215f8578e64SSamuel Holland
216f8578e64SSamuel Holland    ASSERT(. <= BL31_LIMIT, "BL31 image has exceeded its limit.")
217f8578e64SSamuel Holland
218f8578e64SSamuel Holland    . = BL31_NOBITS_BASE;
219f8578e64SSamuel Holland    ASSERT(. == ALIGN(PAGE_SIZE),
220f8578e64SSamuel Holland           "BL31 NOBITS base address is not aligned on a page boundary.")
221f8578e64SSamuel Holland
222f8578e64SSamuel Holland    __NOBITS_START__ = .;
223f8578e64SSamuel Holland#endif
224f8578e64SSamuel Holland
2258d69a03fSSandrine Bailleux    stacks (NOLOAD) : {
2268d69a03fSSandrine Bailleux        __STACKS_START__ = .;
2274f6ad66aSAchin Gupta        *(tzfw_normal_stacks)
2288d69a03fSSandrine Bailleux        __STACKS_END__ = .;
229f8578e64SSamuel Holland    } >NOBITS
2304f6ad66aSAchin Gupta
2318d69a03fSSandrine Bailleux    /*
2328d69a03fSSandrine Bailleux     * The .bss section gets initialised to 0 at runtime.
233308d359bSDouglas Raillard     * Its base address should be 16-byte aligned for better performance of the
234308d359bSDouglas Raillard     * zero-initialization code.
2358d69a03fSSandrine Bailleux     */
236ee7b35c4SAndrew Thoelke    .bss (NOLOAD) : ALIGN(16) {
2378d69a03fSSandrine Bailleux        __BSS_START__ = .;
238ebd6efaeSSamuel Holland        *(SORT_BY_ALIGNMENT(.bss*))
2394f6ad66aSAchin Gupta        *(COMMON)
240ee7b35c4SAndrew Thoelke#if !USE_COHERENT_MEM
241ee7b35c4SAndrew Thoelke        /*
242ee7b35c4SAndrew Thoelke         * Bakery locks are stored in normal .bss memory
243ee7b35c4SAndrew Thoelke         *
244ee7b35c4SAndrew Thoelke         * Each lock's data is spread across multiple cache lines, one per CPU,
245ee7b35c4SAndrew Thoelke         * but multiple locks can share the same cache line.
246ee7b35c4SAndrew Thoelke         * The compiler will allocate enough memory for one CPU's bakery locks,
247ee7b35c4SAndrew Thoelke         * the remaining cache lines are allocated by the linker script
248ee7b35c4SAndrew Thoelke         */
249ee7b35c4SAndrew Thoelke        . = ALIGN(CACHE_WRITEBACK_GRANULE);
250ee7b35c4SAndrew Thoelke        __BAKERY_LOCK_START__ = .;
251596929b9SVarun Wadekar        __PERCPU_BAKERY_LOCK_START__ = .;
252ee7b35c4SAndrew Thoelke        *(bakery_lock)
253ee7b35c4SAndrew Thoelke        . = ALIGN(CACHE_WRITEBACK_GRANULE);
254596929b9SVarun Wadekar        __PERCPU_BAKERY_LOCK_END__ = .;
255596929b9SVarun Wadekar        __PERCPU_BAKERY_LOCK_SIZE__ = ABSOLUTE(__PERCPU_BAKERY_LOCK_END__ - __PERCPU_BAKERY_LOCK_START__);
256ee7b35c4SAndrew Thoelke        . = . + (__PERCPU_BAKERY_LOCK_SIZE__ * (PLATFORM_CORE_COUNT - 1));
257ee7b35c4SAndrew Thoelke        __BAKERY_LOCK_END__ = .;
25832aee841SRoberto Vargas
25932aee841SRoberto Vargas	/*
26032aee841SRoberto Vargas	 * If BL31 doesn't use any bakery lock then __PERCPU_BAKERY_LOCK_SIZE__
26132aee841SRoberto Vargas	 * will be zero. For this reason, the only two valid values for
26232aee841SRoberto Vargas	 * __PERCPU_BAKERY_LOCK_SIZE__ are 0 or the platform defined value
26332aee841SRoberto Vargas	 * PLAT_PERCPU_BAKERY_LOCK_SIZE.
26432aee841SRoberto Vargas	 */
265ee7b35c4SAndrew Thoelke#ifdef PLAT_PERCPU_BAKERY_LOCK_SIZE
26632aee841SRoberto Vargas    ASSERT((__PERCPU_BAKERY_LOCK_SIZE__ == 0) || (__PERCPU_BAKERY_LOCK_SIZE__ == PLAT_PERCPU_BAKERY_LOCK_SIZE),
267ee7b35c4SAndrew Thoelke        "PLAT_PERCPU_BAKERY_LOCK_SIZE does not match bakery lock requirements");
268ee7b35c4SAndrew Thoelke#endif
269ee7b35c4SAndrew Thoelke#endif
270a31d8983SYatharth Kochar
271a31d8983SYatharth Kochar#if ENABLE_PMF
272a31d8983SYatharth Kochar        /*
273a31d8983SYatharth Kochar         * Time-stamps are stored in normal .bss memory
274a31d8983SYatharth Kochar         *
275a31d8983SYatharth Kochar         * The compiler will allocate enough memory for one CPU's time-stamps,
2768aabea33SPaul Beesley         * the remaining memory for other CPUs is allocated by the
277a31d8983SYatharth Kochar         * linker script
278a31d8983SYatharth Kochar         */
279a31d8983SYatharth Kochar        . = ALIGN(CACHE_WRITEBACK_GRANULE);
280a31d8983SYatharth Kochar        __PMF_TIMESTAMP_START__ = .;
281a31d8983SYatharth Kochar        KEEP(*(pmf_timestamp_array))
282a31d8983SYatharth Kochar        . = ALIGN(CACHE_WRITEBACK_GRANULE);
283a31d8983SYatharth Kochar        __PMF_PERCPU_TIMESTAMP_END__ = .;
284a31d8983SYatharth Kochar        __PERCPU_TIMESTAMP_SIZE__ = ABSOLUTE(. - __PMF_TIMESTAMP_START__);
285a31d8983SYatharth Kochar        . = . + (__PERCPU_TIMESTAMP_SIZE__ * (PLATFORM_CORE_COUNT - 1));
286a31d8983SYatharth Kochar        __PMF_TIMESTAMP_END__ = .;
287a31d8983SYatharth Kochar#endif /* ENABLE_PMF */
2888d69a03fSSandrine Bailleux        __BSS_END__ = .;
289f8578e64SSamuel Holland    } >NOBITS
2904f6ad66aSAchin Gupta
291*665e71b8SMasahiro Yamada    XLAT_TABLE_SECTION >NOBITS
292a0cd989dSAchin Gupta
293ab8707e6SSoby Mathew#if USE_COHERENT_MEM
294a0cd989dSAchin Gupta    /*
2958d69a03fSSandrine Bailleux     * The base address of the coherent memory section must be page-aligned (4K)
2968d69a03fSSandrine Bailleux     * to guarantee that the coherent data are stored on their own pages and
2978d69a03fSSandrine Bailleux     * are not mixed with normal data.  This is required to set up the correct
2988d69a03fSSandrine Bailleux     * memory attributes for the coherent data page tables.
2998d69a03fSSandrine Bailleux     */
300a2aedac2SAntonio Nino Diaz    coherent_ram (NOLOAD) : ALIGN(PAGE_SIZE) {
3018d69a03fSSandrine Bailleux        __COHERENT_RAM_START__ = .;
302ee7b35c4SAndrew Thoelke        /*
303ee7b35c4SAndrew Thoelke         * Bakery locks are stored in coherent memory
304ee7b35c4SAndrew Thoelke         *
305ee7b35c4SAndrew Thoelke         * Each lock's data is contiguous and fully allocated by the compiler
306ee7b35c4SAndrew Thoelke         */
307ee7b35c4SAndrew Thoelke        *(bakery_lock)
3088d69a03fSSandrine Bailleux        *(tzfw_coherent_mem)
3098d69a03fSSandrine Bailleux        __COHERENT_RAM_END_UNALIGNED__ = .;
3108d69a03fSSandrine Bailleux        /*
3118d69a03fSSandrine Bailleux         * Memory page(s) mapped to this section will be marked
3128d69a03fSSandrine Bailleux         * as device memory.  No other unexpected data must creep in.
3138d69a03fSSandrine Bailleux         * Ensure the rest of the current memory page is unused.
3148d69a03fSSandrine Bailleux         */
3155629b2b1SRoberto Vargas        . = ALIGN(PAGE_SIZE);
3168d69a03fSSandrine Bailleux        __COHERENT_RAM_END__ = .;
317f8578e64SSamuel Holland    } >NOBITS
318ab8707e6SSoby Mathew#endif
3194f6ad66aSAchin Gupta
320f8578e64SSamuel Holland#if SEPARATE_NOBITS_REGION
321f8578e64SSamuel Holland    /*
322f8578e64SSamuel Holland     * Define a linker symbol to mark end of the NOBITS memory area for this
323f8578e64SSamuel Holland     * image.
324f8578e64SSamuel Holland     */
325f8578e64SSamuel Holland    __NOBITS_END__ = .;
326f8578e64SSamuel Holland
327f8578e64SSamuel Holland    ASSERT(. <= BL31_NOBITS_LIMIT, "BL31 NOBITS region has exceeded its limit.")
328f8578e64SSamuel Holland#else
32954dc71e7SAchin Gupta    /*
33054dc71e7SAchin Gupta     * Define a linker symbol to mark end of the RW memory area for this
33154dc71e7SAchin Gupta     * image.
33254dc71e7SAchin Gupta     */
33354dc71e7SAchin Gupta    __RW_END__ = .;
3348d69a03fSSandrine Bailleux    __BL31_END__ = .;
3354f6ad66aSAchin Gupta
336511046eaSMasahiro Yamada    /DISCARD/ : {
337511046eaSMasahiro Yamada        *(.dynsym .dynstr .hash .gnu.hash)
338511046eaSMasahiro Yamada    }
339511046eaSMasahiro Yamada
340d178637dSJuan Castillo    ASSERT(. <= BL31_LIMIT, "BL31 image has exceeded its limit.")
341f8578e64SSamuel Holland#endif
3424f6ad66aSAchin Gupta}
343