flash.lds 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. OUTPUT_FORMAT("elf32-c33", "elf32-c33",
  2. "elf32-c33")
  3. OUTPUT_ARCH(c33)
  4. MEMORY
  5. {
  6. /*
  7. a0ram (rwx): ORIGIN = 0x00000000, LENGTH = 8k
  8. ivram (rwx): ORIGIN = 0x00080000, LENGTH = 12k
  9. dstram (rwx): ORIGIN = 0x00084000, LENGTH = 2k
  10. */
  11. sdram (rwx): ORIGIN = 0x10000000, LENGTH = 32M
  12. }
  13. SECTIONS
  14. {
  15. .iram : {
  16. *(.suspend_text)
  17. *(.suspend_rodata)
  18. *(.suspend_data)
  19. *(.suspend_bss)
  20. } > a0ram
  21. /*__MAIN_STACK = ORIGIN(sdram) + LENGTH(sdram) - 4; */
  22. __MAIN_STACK = 0x10000000 + 32M - 4;
  23. __MAIN_STACK_LIMIT = __MAIN_STACK - 1M;
  24. .dst_ram : {
  25. *traps.o(.data)
  26. /* traps.o(.*) */
  27. } > dstram
  28. /*__dp = ORIGIN(sdram);*/
  29. __dp = 0x10000000;
  30. /**
  31. * assign 2K of the RAM for IDMA transfer
  32. * must be aligned to a 16 bytes boundry
  33. */
  34. .idma : {
  35. . = . + 2048;
  36. } > sdram
  37. .text : {
  38. *flash.o(*.text)
  39. *(.text)
  40. } > sdram
  41. .rodata : {
  42. *(.rodata)
  43. } > sdram
  44. .data : {
  45. *(.data)
  46. } > sdram
  47. .bss : {
  48. *(.bss)
  49. } > sdram
  50. .comment : {
  51. *flash.o(.comment)
  52. } > sdram
  53. __START_idma = ADDR(.idma);
  54. __END_idma = __START_idma + SIZEOF(.idma);
  55. __START_text = ADDR(.text);
  56. __END_text = __START_text + SIZEOF(.text);
  57. __START_rodata = ADDR(.rodata);
  58. __END_rodata = __START_rodata + SIZEOF(.rodata);
  59. __START_data = ADDR(.data);
  60. __END_data = __START_data + SIZEOF(.data);
  61. __START_bss = ADDR(.bss);
  62. __END_bss = __START_bss + SIZEOF(.bss);
  63. __START_heap = (__END_bss + 1023) & (~ 1023);
  64. __END_heap = __MAIN_STACK_LIMIT & (~ 1023);
  65. __SIZE_heap = __END_heap - __START_heap;
  66. __SIZE_kernel = ADDR(.comment) - ADDR(.text);
  67. }