elf_ia32_efi.lds 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. *(.plt)
  21. . = ALIGN(16);
  22. }
  23. _etext = .;
  24. _text_size = _etext - _text;
  25. . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  26. .data :
  27. {
  28. _data = .;
  29. *(.got.plt)
  30. *(.got)
  31. *(.data)
  32. *(.data1)
  33. *(.data.*)
  34. /*
  35. * Note that these aren't the using the GNU "CONSTRUCTOR" output section
  36. * command, so they don't start with a size. Because of p2align and the
  37. * end/END definitions, and the fact that they're mergeable, they can also
  38. * have NULLs which aren't guaranteed to be at the end.
  39. */
  40. . = ALIGN(16);
  41. __init_array_start = .;
  42. *(SORT(.init_array.*))
  43. *(.init_array)
  44. __init_array_end = .;
  45. . = ALIGN(16);
  46. __CTOR_LIST__ = .;
  47. *(SORT(.ctors.*))
  48. *(.ctors)
  49. __CTOR_END__ = .;
  50. . = ALIGN(16);
  51. __DTOR_LIST__ = .;
  52. *(SORT(.dtors.*))
  53. *(.dtors)
  54. __DTOR_END__ = .;
  55. . = ALIGN(16);
  56. __fini_array_start = .;
  57. *(SORT(.fini_array.*))
  58. *(.fini_array)
  59. __fini_array_end = .;
  60. /* the EFI loader doesn't seem to like a .bss section, so we stick
  61. it all into .data: */
  62. *(.dynbss)
  63. *(.bss*)
  64. *(COMMON)
  65. }
  66. .note.gnu.build-id : { *(.note.gnu.build-id) }
  67. . = ALIGN(4096);
  68. .dynamic : { *(.dynamic) }
  69. . = ALIGN(4096);
  70. .rel :
  71. {
  72. *(.rel.text*)
  73. *(.rel.data*)
  74. *(.rel.got)
  75. *(.rel.dyn)
  76. *(.rel.stab)
  77. *(.rel.init_array*)
  78. *(.rel.fini_array*)
  79. *(.rel.ctors*)
  80. *(.rel.dtors*)
  81. *(.data.rel.ro.local)
  82. *(.data.rel.local)
  83. *(.data.rel.ro)
  84. *(.data.rel*)
  85. }
  86. . = ALIGN(4096);
  87. .rel.plt : { *(.rel.plt) }
  88. . = ALIGN(4096);
  89. .rodata : { *(.rodata*) }
  90. _edata = .;
  91. _data_size = _edata - _etext;
  92. . = ALIGN(4096);
  93. .reloc : /* This is the PECOFF .reloc section! */
  94. {
  95. KEEP (*(.reloc))
  96. }
  97. . = ALIGN(4096);
  98. .dynsym : { *(.dynsym) }
  99. . = ALIGN(4096);
  100. .dynstr : { *(.dynstr) }
  101. . = ALIGN(4096);
  102. . = DATA_SEGMENT_END (.);
  103. /DISCARD/ :
  104. {
  105. *(.rel.reloc)
  106. *(.note.GNU-stack)
  107. }
  108. .comment 0 : { *(.comment) }
  109. }