lpc2148_rom.ld 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. . = ALIGN(4);
  37. __rt_init_start = .;
  38. KEEP(*(SORT(.rti_fn*)))
  39. __rt_init_end = .;
  40. . = ALIGN(4);
  41. } >CODE
  42. . = ALIGN(4);
  43. .ctors :
  44. {
  45. PROVIDE(__ctors_start__ = .);
  46. KEEP(*(SORT(.ctors.*)))
  47. KEEP(*(.ctors))
  48. PROVIDE(__ctors_end__ = .);
  49. } > CODE
  50. .dtors :
  51. {
  52. PROVIDE(__dtors_start__ = .);
  53. KEEP(*(SORT(.dtors.*)))
  54. KEEP(*(.dtors))
  55. PROVIDE(__dtors_end__ = .);
  56. } > CODE
  57. __end_of_text__ = .;
  58. /* .ARM.exidx is sorted, so has to go in its own output section. */
  59. __exidx_start = .;
  60. .ARM.exidx :
  61. {
  62. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  63. /* This is used by the startup in order to initialize the .data secion */
  64. _sidata = .;
  65. } > CODE
  66. __exidx_end = .;
  67. /* .data section which is used for initialized data */
  68. .data : AT (_sidata)
  69. {
  70. . = ALIGN(4);
  71. /* This is used by the startup in order to initialize the .data secion */
  72. _sdata = . ;
  73. *(.data)
  74. *(.data.*)
  75. *(.gnu.linkonce.d*)
  76. . = ALIGN(4);
  77. /* This is used by the startup in order to initialize the .data secion */
  78. _edata = . ;
  79. } >DATA
  80. __data_end = .;
  81. .noinit :
  82. {
  83. *(.bss.noinit)
  84. } > DATA
  85. .stack :
  86. {
  87. . = ALIGN(4);
  88. _undefined_stack_base = .;
  89. . = . + _undefined_tack_size;
  90. _undefined_stack_top = .;
  91. _abort_stack_base = .;
  92. . = . + _abort_tack_size;
  93. _abort_stack_top = .;
  94. _fiq_stack_base = .;
  95. . = . + _fiq_tack_size;
  96. _fiq_stack_top = .;
  97. _irq_stack_base = .;
  98. . = . + _irq_tack_size;
  99. _irq_stack_top = .;
  100. _svc_stack_base = .;
  101. . = . + _svc_tack_size;
  102. _svc_stack_top = .;
  103. } >DATA
  104. __bss_start = .;
  105. .bss :
  106. {
  107. . = ALIGN(4);
  108. /* This is used by the startup in order to initialize the .bss secion */
  109. _sbss = .;
  110. *(.bss)
  111. *(COMMON)
  112. . = ALIGN(4);
  113. /* This is used by the startup in order to initialize the .bss secion */
  114. _ebss = . ;
  115. } > DATA
  116. __bss_end = .;
  117. /* Align here to ensure that the .bss section occupies space up to
  118. _end. Align after .bss to ensure correct alignment even if the
  119. .bss section disappears because there are no input sections. */
  120. . = ALIGN(32 / 8);
  121. }