link.x.in 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. PROVIDE(_stext = ORIGIN(REGION_TEXT));
  2. SECTIONS {
  3. .text _stext :
  4. {
  5. __kernel_start = .;
  6. __stext = .;
  7. *(.text.entry);
  8. *(.text .text.*);
  9. } > REGION_TEXT AT> LINK_REGION_TEXT
  10. __etext = .;
  11. .rodata : ALIGN(16)
  12. {
  13. __srodata = .;
  14. *(.rodata .rodata.*);
  15. } > REGION_RODATA AT> LINK_REGION_RODATA
  16. __erodata = .;
  17. .data : ALIGN(16)
  18. {
  19. __sdata = .;
  20. *(.data .data.*);
  21. *(.got .got.plt);
  22. } > REGION_DATA AT> LINK_REGION_DATA
  23. __edata = .;
  24. .bss (NOLOAD) : ALIGN(16)
  25. {
  26. __sbss = .;
  27. *(.bss .bss.*);
  28. . = ALIGN(0x1000);
  29. } > REGION_BSS AT> LINK_REGION_BSS
  30. __ebss = .;
  31. .eh_frame : ALIGN(16)
  32. {
  33. __seh_frame = .;
  34. KEEP(*(.eh_frame .eh_frame*));
  35. } > REGION_EHFRAME AT> LINK_REGION_EHFRAME
  36. . = ALIGN(0x1000);
  37. __eeh_frame = .;
  38. }
  39. SECTIONS {
  40. /* Stabs debugging sections. */
  41. .stab 0 : { KEEP(*(.stab)); }
  42. .stabstr 0 : { KEEP(*(.stabstr)); }
  43. .stab.excl 0 : { KEEP(*(.stab.excl)); }
  44. .stab.exclstr 0 : { KEEP(*(.stab.exclstr)); }
  45. .stab.index 0 : { KEEP(*(.stab.index)); }
  46. .stab.indexstr 0 : { KEEP(*(.stab.indexstr)); }
  47. .comment 0 : { KEEP(*(.comment)); }
  48. /* DWARF debug sections.
  49. Symbols in the DWARF debugging sections are relative to the beginning
  50. of the section so we begin them at 0. */
  51. /* DWARF 1 */
  52. .debug 0 : { KEEP(*(.debug)); }
  53. .line 0 : { KEEP(*(.line)); }
  54. /* GNU DWARF 1 extensions */
  55. .debug_srcinfo 0 : { KEEP(*(.debug_srcinfo)); }
  56. .debug_sfnames 0 : { KEEP(*(.debug_sfnames)); }
  57. /* DWARF 1.1 and DWARF 2 */
  58. .debug_aranges 0 : { KEEP(*(.debug_aranges)); }
  59. .debug_pubnames 0 : { KEEP(*(.debug_pubnames)); }
  60. /* DWARF 2 */
  61. .debug_info 0 : { KEEP(*(.debug_info)); }
  62. .debug_abbrev 0 : { KEEP(*(.debug_abbrev)); }
  63. .debug_line 0 : { KEEP(*(.debug_line)); }
  64. .debug_frame 0 : { KEEP(*(.debug_frame)); }
  65. .debug_str 0 : { KEEP(*(.debug_str)); }
  66. .debug_loc 0 : { KEEP(*(.debug_loc)); }
  67. .debug_macinfo 0 : { KEEP(*(.debug_macinfo)); }
  68. /* SGI/MIPS DWARF 2 extensions */
  69. .debug_weaknames 0 : { KEEP(*(.debug_weaknames)); }
  70. .debug_funcnames 0 : { KEEP(*(.debug_funcnames)); }
  71. .debug_typenames 0 : { KEEP(*(.debug_typenames)); }
  72. .debug_varnames 0 : { KEEP(*(.debug_varnames)); }
  73. /* DWARF Other */
  74. .debug_ranges 0 : { KEEP(*(.debug_ranges)); }
  75. .debug_line_str 0 : { KEEP(*(.debug_line_str)); }
  76. /DISCARD/ :
  77. {
  78. *(.fini_array*)
  79. *(.note*)
  80. *(.dtors*)
  81. *(.debug_gdb_scripts*)
  82. }
  83. }