build_axf.ld.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2023, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. * Linker script for the Arm Ltd. FPGA boards to generate an ELF file that
  7. * contains the ROM trampoline, BL31 and the DTB.
  8. *
  9. * This allows to pass just one file to the uploader tool, and automatically
  10. * provides the correct load addresses.
  11. */
  12. #include <platform_def.h>
  13. OUTPUT_FORMAT("elf64-littleaarch64")
  14. OUTPUT_ARCH(aarch64)
  15. INPUT(./rom_trampoline.o)
  16. INPUT(./kernel_trampoline.o)
  17. TARGET(binary)
  18. INPUT(./bl31.bin)
  19. INPUT(./fdts/arm_fpga.dtb)
  20. ENTRY(_start)
  21. SECTIONS
  22. {
  23. .rom (0x0): {
  24. *rom_trampoline.o(.text*)
  25. KEEP(*(.rom))
  26. }
  27. .bl31 (BL31_BASE): {
  28. ASSERT(. == ALIGN(PAGE_SIZE), "BL31_BASE is not page aligned");
  29. *bl31.bin
  30. }
  31. .dtb (FPGA_PRELOADED_DTB_BASE): {
  32. ASSERT(. == ALIGN(8), "DTB address is not 8-byte aligned");
  33. *arm_fpga.dtb
  34. }
  35. .kern_tramp (PRELOADED_BL33_BASE): {
  36. *kernel_trampoline.o(.text*)
  37. KEEP(*(.kern_tramp))
  38. }
  39. /DISCARD/ : { *(.stacks) }
  40. /DISCARD/ : { *(.debug_*) }
  41. /DISCARD/ : { *(.note*) }
  42. /DISCARD/ : { *(.comment*) }
  43. }