link.lds 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
  2. OUTPUT_ARCH(i386)
  3. ENTRY(_start)
  4. SECTIONS
  5. {
  6. . = 0x00100000;
  7. . = ALIGN(4);
  8. __text_start = .;
  9. .text :
  10. {
  11. _stext = .;
  12. *(.init)
  13. *(.text)
  14. /* section information for utest */
  15. . = ALIGN(4);
  16. __rt_utest_tc_tab_start = .;
  17. KEEP(*(UtestTcTab))
  18. __rt_utest_tc_tab_end = .;
  19. /* section information for finsh shell */
  20. . = ALIGN(4);
  21. __fsymtab_start = .;
  22. KEEP(*(FSymTab))
  23. __fsymtab_end = .;
  24. . = ALIGN(4);
  25. __vsymtab_start = .;
  26. KEEP(*(VSymTab))
  27. __vsymtab_end = .;
  28. . = ALIGN(4);
  29. /* section information for modules */
  30. . = ALIGN(4);
  31. __rtmsymtab_start = .;
  32. KEEP(*(RTMSymTab))
  33. __rtmsymtab_end = .;
  34. /* section information for initialization */
  35. . = ALIGN(4);
  36. __rt_init_start = .;
  37. KEEP(*(SORT(.rti_fn*)))
  38. __rt_init_end = .;
  39. _etext = .; /* define a global symbols at end of code */
  40. } =0
  41. __text_end = .;
  42. . = ALIGN(4);
  43. __rodata_start = .;
  44. .rodata : { *(.rodata) *(.rodata.*) }
  45. __rodata_end = .;
  46. . = ALIGN(4);
  47. .ctors :
  48. {
  49. PROVIDE(__ctors_start__ = .);
  50. KEEP(*(SORT(.ctors.*)))
  51. KEEP(*(.ctors))
  52. PROVIDE(__ctors_end__ = .);
  53. }
  54. .dtors :
  55. {
  56. PROVIDE(__dtors_start__ = .);
  57. KEEP(*(SORT(.dtors.*)))
  58. KEEP(*(.dtors))
  59. PROVIDE(__dtors_end__ = .);
  60. }
  61. . = ALIGN(4);
  62. __data_start = .;
  63. .data :
  64. {
  65. *(.data)
  66. *(.data.*)
  67. }
  68. __data_end = .;
  69. . = ALIGN(4);
  70. __bss_start = .;
  71. .bss :
  72. {
  73. *(.bss)
  74. *(.bss.*)
  75. *(COMMON)
  76. . = ALIGN(4);
  77. }
  78. . = ALIGN(4);
  79. __bss_end = .;
  80. /* stabs debugging sections. */
  81. .stab 0 : { *(.stab) }
  82. .stabstr 0 : { *(.stabstr) }
  83. .stab.excl 0 : { *(.stab.excl) }
  84. .stab.exclstr 0 : { *(.stab.exclstr) }
  85. .stab.index 0 : { *(.stab.index) }
  86. .stab.indexstr 0 : { *(.stab.indexstr) }
  87. .comment 0 : { *(.comment) }
  88. .debug_abbrev 0 : { *(.debug_abbrev) }
  89. .debug_info 0 : { *(.debug_info) }
  90. .debug_line 0 : { *(.debug_line) }
  91. .debug_pubnames 0 : { *(.debug_pubnames) }
  92. .debug_aranges 0 : { *(.debug_aranges) }
  93. _end = .;
  94. }