common_bl.ld 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Memory layout for bootloader configuration (this here describes the app part):
  2. FLASH_APP .isr_vector
  3. FLASH_APP .text
  4. FLASH_APP .data
  5. RAM .data
  6. RAM .bss
  7. RAM .heap
  8. RAM .stack
  9. */
  10. ENTRY(Reset_Handler)
  11. /* define output sections */
  12. SECTIONS
  13. {
  14. /* The startup code goes first into FLASH */
  15. .isr_vector :
  16. {
  17. . = ALIGN(4);
  18. KEEP(*(.isr_vector)) /* Startup code */
  19. . = ALIGN(4);
  20. } >FLASH_APP
  21. /* The program code and other data goes into FLASH */
  22. .text :
  23. {
  24. . = ALIGN(4);
  25. *(.text*) /* .text* sections (code) */
  26. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  27. /* *(.glue_7) */ /* glue arm to thumb code */
  28. /* *(.glue_7t) */ /* glue thumb to arm code */
  29. . = ALIGN(4);
  30. _etext = .; /* define a global symbol at end of code */
  31. } >FLASH_APP
  32. /* used by the startup to initialize data */
  33. _sidata = LOADADDR(.data);
  34. /* This is the initialized data section
  35. The program executes knowing that the data is in the RAM
  36. but the loader puts the initial values in the FLASH (inidata).
  37. It is one task of the startup to copy the initial values from FLASH to RAM. */
  38. .data :
  39. {
  40. . = ALIGN(4);
  41. _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
  42. *(.data*) /* .data* sections */
  43. . = ALIGN(4);
  44. _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
  45. } >RAM AT> FLASH_APP
  46. /* Uninitialized data section */
  47. .bss :
  48. {
  49. . = ALIGN(4);
  50. _sbss = .; /* define a global symbol at bss start; used by startup code */
  51. *(.bss*)
  52. *(COMMON)
  53. . = ALIGN(4);
  54. _ebss = .; /* define a global symbol at bss end; used by startup code and GC */
  55. } >RAM
  56. /* this is to define the start of the heap, and make sure we have a minimum size */
  57. .heap :
  58. {
  59. . = ALIGN(4);
  60. . = . + _minimum_heap_size;
  61. . = ALIGN(4);
  62. } >RAM
  63. /* this just checks there is enough RAM for the stack */
  64. .stack :
  65. {
  66. . = ALIGN(4);
  67. . = . + _minimum_stack_size;
  68. . = ALIGN(4);
  69. } >RAM
  70. .ARM.attributes 0 : { *(.ARM.attributes) }
  71. }