lpc2148_rom.ld 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  2. OUTPUT_ARCH(arm)
  3. MEMORY
  4. {
  5. CODE (rx) : ORIGIN = 0x00000000, LENGTH = 512k /* 512KB flash */
  6. DATA (rw) : ORIGIN = 0x40000000, LENGTH = 32k /* 32K sram */
  7. }
  8. ENTRY(_start)
  9. _undefined_tack_size = 0x40;
  10. _abort_tack_size = 0x40;
  11. _fiq_tack_size = 0x100;
  12. _irq_tack_size = 0x200;
  13. _svc_tack_size = 0x400;
  14. SECTIONS
  15. {
  16. . = 0;
  17. . = ALIGN(4);
  18. .text :
  19. {
  20. *(.init)
  21. *(.text)
  22. *(.rodata)
  23. *(.rodata*)
  24. *(.glue_7)
  25. *(.glue_7t)
  26. /* section information for finsh shell */
  27. . = ALIGN(4);
  28. __fsymtab_start = .;
  29. KEEP(*(FSymTab))
  30. __fsymtab_end = .;
  31. . = ALIGN(4);
  32. __vsymtab_start = .;
  33. KEEP(*(VSymTab))
  34. __vsymtab_end = .;
  35. . = ALIGN(4);
  36. } >CODE
  37. . = ALIGN(4);
  38. .ctors :
  39. {
  40. PROVIDE(__ctors_start__ = .);
  41. KEEP(*(SORT(.ctors.*)))
  42. KEEP(*(.ctors))
  43. PROVIDE(__ctors_end__ = .);
  44. } > CODE
  45. .dtors :
  46. {
  47. PROVIDE(__dtors_start__ = .);
  48. KEEP(*(SORT(.dtors.*)))
  49. KEEP(*(.dtors))
  50. PROVIDE(__dtors_end__ = .);
  51. } > CODE
  52. __end_of_text__ = .;
  53. /* .ARM.exidx is sorted, so has to go in its own output section. */
  54. __exidx_start = .;
  55. .ARM.exidx :
  56. {
  57. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  58. /* This is used by the startup in order to initialize the .data secion */
  59. _sidata = .;
  60. } > CODE
  61. __exidx_end = .;
  62. /* .data section which is used for initialized data */
  63. .data : AT (_sidata)
  64. {
  65. . = ALIGN(4);
  66. /* This is used by the startup in order to initialize the .data secion */
  67. _sdata = . ;
  68. *(.data)
  69. *(.data.*)
  70. *(.gnu.linkonce.d*)
  71. . = ALIGN(4);
  72. /* This is used by the startup in order to initialize the .data secion */
  73. _edata = . ;
  74. } >DATA
  75. __data_end = .;
  76. .noinit :
  77. {
  78. *(.bss.noinit)
  79. } > DATA
  80. .stack :
  81. {
  82. . = ALIGN(4);
  83. _undefined_stack_base = .;
  84. . = . + _undefined_tack_size;
  85. _undefined_stack_top = .;
  86. _abort_stack_base = .;
  87. . = . + _abort_tack_size;
  88. _abort_stack_top = .;
  89. _fiq_stack_base = .;
  90. . = . + _fiq_tack_size;
  91. _fiq_stack_top = .;
  92. _irq_stack_base = .;
  93. . = . + _irq_tack_size;
  94. _irq_stack_top = .;
  95. _svc_stack_base = .;
  96. . = . + _svc_tack_size;
  97. _svc_stack_top = .;
  98. } >DATA
  99. __bss_start = .;
  100. .bss :
  101. {
  102. . = ALIGN(4);
  103. /* This is used by the startup in order to initialize the .bss secion */
  104. _sbss = .;
  105. *(.bss)
  106. *(COMMON)
  107. . = ALIGN(4);
  108. /* This is used by the startup in order to initialize the .bss secion */
  109. _ebss = . ;
  110. } > DATA
  111. __bss_end = .;
  112. /* Align here to ensure that the .bss section occupies space up to
  113. _end. Align after .bss to ensure correct alignment even if the
  114. .bss section disappears because there are no input sections. */
  115. . = ALIGN(32 / 8);
  116. }