8811_sram.ld 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. EXTERN(gRomFunctionTable)
  18. #define entry_contents *(RESET)
  19. #define sramboottext_contents KEEP(*(VECTORS)) SORT(*)(.sramboottext .sramboottext.*)
  20. #define sramtext_contents SORT(*)(.sramtext .sramtext.*)
  21. #define ramtext_contents SORT(*)(.ramtext .ramtext.*)
  22. #define text_contents SORT(*)(DEF_RO) KEEP(*(.rokeep))
  23. #define sramdata_contents SORT(*)(.sramdata .sramdata.* .bootsramdata .sramucdata)
  24. #define data_contents SORT(*)(DEF_RW) KEEP(*(.rwkeep))
  25. #define srambss_contents *(.srambss .srambss.* .sramuninit .sramucbss)
  26. #define bss_contents *(DEF_ZI .ucdata .ucbackup)
  27. #define init_array_contents KEEP(*(.init_array*))
  28. #define nbrom_funclist_contents KEEP(*(.rom_funclist))
  29. #define trace_sn_contents KEEP(*(.trace_sn))
  30. #ifndef CONFIG_BSCORE_ENABLE
  31. #undef CONFIG_BSCORE_SIZE
  32. #define CONFIG_BSCORE_SIZE 0
  33. #endif
  34. #define HEAP_END (ORIGIN(sram) + LENGTH(sram) - CONFIG_IRQ_STACK_SIZE - CONFIG_BLUE_SCREEN_SIZE - CONFIG_BSCORE_SIZE - CONFIG_TRACE_SN_SIZE)
  35. MEMORY {
  36. flash(rx): ORIGIN = CONFIG_APP_FLASH_ADDRESS, LENGTH = CONFIG_APP_FLASH_SIZE
  37. sram(rwx): ORIGIN = CONFIG_APP_SRAM_ADDRESS, LENGTH = CONFIG_APP_SRAM_SIZE
  38. nbsram(rw): ORIGIN = CONFIG_NBROM_SRAM_START, LENGTH = CONFIG_NBROM_SRAM_SIZE
  39. }
  40. SECTIONS {
  41. #include "nbrom_for_link.ld"
  42. NOLOAD_SIZE_SECT(simage, CONFIG_SIMAGE_HEADER_SIZE) >flash
  43. ANCHOR_SECT(flash_start) >flash
  44. NOAT_SECT(entry) >flash
  45. LOAD_SECT(sramboottext) >sram AT>flash
  46. LOAD_SECT(sramtext) >sram AT>flash
  47. LOAD_SECT(ramtext) >sram AT>flash
  48. NOAT_SECT(init_array) >flash
  49. NOAT_SECT(text) >flash
  50. LOAD_SECT(sramdata) >sram AT>flash
  51. LOAD_SECT(data) >sram AT>flash
  52. NOLOAD_SECT(srambss) >sram
  53. NOLOAD_SECT(bss) >sram
  54. NOLOAD_END_SECT(heap, HEAP_END) >sram
  55. NOLOAD_SIZE_SECT(blue_screen, CONFIG_BLUE_SCREEN_SIZE) >sram
  56. NOLOAD_SIZE_SECT(irq_stack, CONFIG_IRQ_STACK_SIZE) >sram
  57. NOLOAD_SIZE_SECT(bscore, CONFIG_BSCORE_SIZE) >sram
  58. NOLOAD_SECT(trace_sn) >sram
  59. LOAD_SECT(nbrom_funclist) >nbsram AT>flash
  60. ANCHOR_SECT(flash_end) >flash
  61. IGNORE_DISCARD_SECTS
  62. }