elf_ia32_efi.lds 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
  2. OUTPUT_ARCH(i386)
  3. ENTRY(_start)
  4. SECTIONS
  5. {
  6. . = 0;
  7. ImageBase = .;
  8. /* .hash and/or .gnu.hash MUST come first! */
  9. .hash : { *(.hash) }
  10. .gnu.hash : { *(.gnu.hash) }
  11. .eh_frame : { *(.eh_frame) }
  12. .gcc_except_table : { *(.gcc_except_table*) }
  13. . = ALIGN(4096);
  14. .text :
  15. {
  16. _text = .;
  17. *(.text)
  18. *(.text.*)
  19. *(.gnu.linkonce.t.*)
  20. . = ALIGN(16);
  21. }
  22. _etext = .;
  23. _text_size = . - _text;
  24. . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  25. .sdata :
  26. {
  27. _data = .;
  28. *(.got.plt)
  29. *(.got)
  30. *(.srodata)
  31. *(.sdata)
  32. *(.sbss)
  33. *(.scommon)
  34. }
  35. . = ALIGN(4096);
  36. .data :
  37. {
  38. *(.rodata*)
  39. *(.data)
  40. *(.data1)
  41. *(.data.*)
  42. *(.sdata)
  43. *(.got.plt)
  44. *(.got)
  45. /*
  46. * Note that these aren't the using the GNU "CONSTRUCTOR" output section
  47. * command, so they don't start with a size. Because of p2align and the
  48. * end/END definitions, and the fact that they're mergeable, they can also
  49. * have NULLs which aren't guaranteed to be at the end.
  50. */
  51. . = ALIGN(16);
  52. _init_array = .;
  53. *(SORT_BY_NAME(.init_array))
  54. _init_array_end = .;
  55. __CTOR_LIST__ = .;
  56. *(SORT_BY_NAME(.ctors))
  57. __CTOR_END__ = .;
  58. __DTOR_LIST__ = .;
  59. *(SORT_BY_NAME(.dtors))
  60. __DTOR_END__ = .;
  61. _fini_array = .;
  62. *(SORT_BY_NAME(.fini_array))
  63. _fini_array_end = .;
  64. /* the EFI loader doesn't seem to like a .bss section, so we stick
  65. it all into .data: */
  66. *(.sbss)
  67. *(.scommon)
  68. *(.dynbss)
  69. *(.bss*)
  70. *(COMMON)
  71. }
  72. .note.gnu.build-id : { *(.note.gnu.build-id) }
  73. . = ALIGN(4096);
  74. .dynamic : { *(.dynamic) }
  75. . = ALIGN(4096);
  76. .rel :
  77. {
  78. *(.rel.text*)
  79. *(.rel.sdata*)
  80. *(.rel.data*)
  81. *(.rel.got)
  82. *(.rel.dyn)
  83. *(.rel.stab)
  84. *(.data.rel.ro.local)
  85. *(.data.rel.local)
  86. *(.data.rel.ro)
  87. *(.data.rel*)
  88. }
  89. . = ALIGN(4096);
  90. .rel.plt : { *(.rel.plt) }
  91. _edata = .;
  92. _data_size = . - _etext;
  93. . = ALIGN(4096);
  94. .reloc : /* This is the PECOFF .reloc section! */
  95. {
  96. KEEP (*(.reloc))
  97. }
  98. . = ALIGN(4096);
  99. .dynsym : { *(.dynsym) }
  100. . = ALIGN(4096);
  101. .dynstr : { *(.dynstr) }
  102. . = ALIGN(4096);
  103. . = DATA_SEGMENT_END (.);
  104. /DISCARD/ :
  105. {
  106. *(.rel.reloc)
  107. *(.note.GNU-stack)
  108. }
  109. .comment 0 : { *(.comment) }
  110. }