ble.ld.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2018 Marvell International Ltd.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. * https://spdx.org/licenses
  6. */
  7. #include <platform_def.h>
  8. OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
  9. OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
  10. ENTRY(ble_main)
  11. MEMORY {
  12. RAM (rwx): ORIGIN = BLE_BASE, LENGTH = BLE_LIMIT - BLE_BASE
  13. }
  14. SECTIONS
  15. {
  16. . = BLE_BASE;
  17. .ro . : {
  18. __RO_START__ = .;
  19. *ble_main.o(.entry*)
  20. *(.text*)
  21. *(.rodata*)
  22. __RO_END_UNALIGNED__ = .;
  23. __RO_END__ = .;
  24. } >RAM
  25. /*
  26. * Define a linker symbol to mark start of the RW memory area for this
  27. * image.
  28. */
  29. __RW_START__ = . ;
  30. .data . : {
  31. __DATA_START__ = .;
  32. *(.data*)
  33. __DATA_END__ = .;
  34. } >RAM
  35. .stacks . (NOLOAD) : {
  36. __STACKS_START__ = .;
  37. *(.tzfw_normal_stacks)
  38. __STACKS_END__ = .;
  39. } >RAM
  40. .bss : {
  41. __BSS_START__ = .;
  42. *(.bss*)
  43. __BSS_END__ = .;
  44. } >RAM
  45. /*
  46. * Extend the BLE binary to the maximum size allocated for it in platform
  47. * definition files and prevent overlapping between BLE BSS section and
  48. * additional extensions that can follow the BLE in flash image preamble.
  49. * This situation happens for instance when secure extension is added to
  50. * the image preamble.
  51. */
  52. .fill LOADADDR(.bss) + SIZEOF(.bss) : {
  53. FILL(0xDEADC0DE);
  54. . = ORIGIN(RAM) + LENGTH(RAM) - 1;
  55. BYTE(0x00)
  56. } >RAM
  57. /*
  58. * Define a linker symbol to mark end of the RW memory area for this
  59. * image.
  60. */
  61. __RW_END__ = .;
  62. __BLE_END__ = .;
  63. __BSS_SIZE__ = SIZEOF(.bss);
  64. }