linker.ld.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <common/bl_common.ld.h>
  7. #include <lib/xlat_tables/xlat_tables_defs.h>
  8. /* Mapped using 4K pages, requires us to align different sections with
  9. * different property at the same granularity. */
  10. PAGE_SIZE_4K = 4096;
  11. OUTPUT_FORMAT("elf64-littleaarch64")
  12. OUTPUT_ARCH(aarch64)
  13. ENTRY(trp_head)
  14. MEMORY {
  15. RAM (rwx): ORIGIN = RMM_BASE, LENGTH = RMM_LIMIT - RMM_BASE
  16. }
  17. SECTIONS
  18. {
  19. . = RMM_BASE;
  20. .text : {
  21. *(.head.text)
  22. . = ALIGN(8);
  23. *(.text*)
  24. } >RAM
  25. . = ALIGN(PAGE_SIZE_4K);
  26. .rodata : {
  27. *(.rodata*)
  28. } >RAM
  29. . = ALIGN(PAGE_SIZE_4K);
  30. __RW_START__ = . ;
  31. .data : {
  32. *(.data*)
  33. } >RAM
  34. .bss (NOLOAD) : {
  35. __BSS_START__ = .;
  36. *(.bss*)
  37. __BSS_END__ = .;
  38. } >RAM
  39. __BSS_SIZE__ = SIZEOF(.bss);
  40. STACK_SECTION >RAM
  41. /*
  42. * Define a linker symbol to mark the end of the RW memory area for this
  43. * image.
  44. */
  45. __RW_END__ = .;
  46. __RMM_END__ = .;
  47. /DISCARD/ : { *(.dynstr*) }
  48. /DISCARD/ : { *(.dynamic*) }
  49. /DISCARD/ : { *(.plt*) }
  50. /DISCARD/ : { *(.interp*) }
  51. /DISCARD/ : { *(.gnu*) }
  52. /DISCARD/ : { *(.note*) }
  53. }