8910_ddrrun.ld 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #include "link_defs.ld"
  13. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  14. OUTPUT_ARCH(arm)
  15. ENTRY(Reset_Handler)
  16. EXTERN(Reset_Handler)
  17. #define ttb_contents *(.TTBL1) *(.TTBL2)
  18. #define entry_contents *(RESET)
  19. #define sramboottext_contents SORT(*)(.sramboottext .sramboottext.*)
  20. #define sramtext_contents *(VECTORS) \
  21. *libkernel.a:portASM.*(DEF_RO) \
  22. *libkernel.a:port.*(DEF_RO) \
  23. SORT(*)(.sramtext .sramtext.*)
  24. #define text_contents *libkernel.a:boot_start.*(DEF_RO) \
  25. *libkernel.a:osi_debug.*(DEF_RO) \
  26. *libhal.a:hal_clock_init.*(DEF_RO) \
  27. *libhal.a:hal_mmu.*(DEF_RO)
  28. #define ramtext_contents SORT(*)(DEF_RO) \
  29. SORT(*)(.ramtext .ramtext.*)
  30. #define srambootdata_contents SORT(*)(.srambootdata .srambootdata.*)
  31. #define sramdata_contents SORT(*)(.sramdata .sramdata.*)
  32. #define data_contents SORT(*)(DEF_RW)
  33. #define srambootbss_contents *(.srambootbss .srambootbss.*)
  34. #define srambss_contents *(.srambss .srambss.*)
  35. #define bss_contents *(DEF_ZI)
  36. #define init_array_contents KEEP(*(.init_array*))
  37. #define SRAM_HEAP_END (ORIGIN(sram) + LENGTH(sram) - CONFIG_IRQ_STACK_SIZE - CONFIG_SVC_STACK_SIZE - CONFIG_BLUE_SCREEN_SIZE)
  38. MEMORY {
  39. flash(rx): ORIGIN = CONFIG_APP_FLASH_ADDRESS, LENGTH = CONFIG_APP_FLASH_SIZE
  40. ram(rwx): ORIGIN = CONFIG_APP_RAM_ADDRESS, LENGTH = CONFIG_APP_RAM_SIZE
  41. sram(rwx): ORIGIN = CONFIG_APP_SRAM_ADDRESS, LENGTH = CONFIG_APP_SRAM_SIZE
  42. }
  43. SECTIONS {
  44. NOLOAD_SIZE_SECT(uimage, CONFIG_UIMAGE_HEADER_SIZE) > flash
  45. ANCHOR_SECT(flash_start) > flash
  46. NOAT_SECT_ALIGNED(ttb, 16384) > ram
  47. NOAT_SECT(entry) > flash
  48. LOAD_SECT(sramboottext) >sram AT>flash
  49. LOAD_SECT(sramtext) >sram AT>flash
  50. LOAD_SECT(ramtext) >ram AT>flash
  51. NOAT_SECT(init_array) > flash
  52. NOAT_SECT(text) > flash
  53. LOAD_SECT(sramdata) >sram AT>flash
  54. LOAD_SECT(data) >ram AT>flash
  55. NOLOAD_SECT(srambss) > sram
  56. ANCHOR_SECT(sram_end) > sram
  57. NOLOAD_END_SECT(sram_heap, SRAM_HEAP_END) > sram
  58. NOLOAD_SIZE_SECT(blue_screen, CONFIG_BLUE_SCREEN_SIZE) > sram
  59. NOLOAD_SIZE_SECT(svc_stack, CONFIG_SVC_STACK_SIZE) > sram
  60. NOLOAD_SIZE_SECT(irq_stack, CONFIG_IRQ_STACK_SIZE) > sram
  61. NOLOAD_SECT(bss) > ram
  62. NOLOAD_END_SECT(heap, ORIGIN(ram) + LENGTH(ram)) > ram
  63. ANCHOR_SECT(flash_end) > flash
  64. IGNORE_DISCARD_SECTS
  65. }