arm_reclaim_init.ld.S 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef ARM_RECLAIM_INIT_LD_S
  7. #define ARM_RECLAIM_INIT_LD_S
  8. SECTIONS
  9. {
  10. .init __STACKS_START__ : {
  11. . = . + PLATFORM_STACK_SIZE;
  12. . = ALIGN(PAGE_SIZE);
  13. __INIT_CODE_START__ = .;
  14. *(*text.init.*);
  15. __INIT_CODE_END__ = .;
  16. INIT_CODE_END_ALIGNED = ALIGN(PAGE_SIZE);
  17. } >RAM
  18. #ifdef BL31_PROGBITS_LIMIT
  19. ASSERT(__INIT_CODE_END__ <= BL31_PROGBITS_LIMIT,
  20. "BL31 init has exceeded progbits limit.")
  21. #endif
  22. }
  23. #define ABS ABSOLUTE
  24. #define STACK_SECTION \
  25. .stacks (NOLOAD) : { \
  26. __STACKS_START__ = .; \
  27. *(.tzfw_normal_stacks) \
  28. __STACKS_END__ = .; \
  29. /* Allow room for the init section where necessary. */ \
  30. OFFSET = ABS(SIZEOF(.init) - (. - __STACKS_START__)); \
  31. /* Offset sign */ \
  32. SIGN = ABS(OFFSET) & (1 << 63); \
  33. /* Offset mask */ \
  34. MASK = ABS(SIGN >> 63) - 1; \
  35. . += ABS(OFFSET) & ABS(MASK); \
  36. . = ALIGN(PAGE_SIZE); \
  37. }
  38. #endif /* ARM_RECLAIM_INIT_LD_S */