vmlinux.lds.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <asm-generic/vmlinux.lds.h>
  3. OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT)
  4. #undef i386
  5. #include <asm/cache.h>
  6. #include <asm/page_types.h>
  7. #ifdef CONFIG_X86_64
  8. OUTPUT_ARCH(i386:x86-64)
  9. ENTRY(startup_64)
  10. #else
  11. OUTPUT_ARCH(i386)
  12. ENTRY(startup_32)
  13. #endif
  14. SECTIONS
  15. {
  16. /* Be careful parts of head_64.S assume startup_32 is at
  17. * address 0.
  18. */
  19. . = 0;
  20. .head.text : {
  21. _head = . ;
  22. HEAD_TEXT
  23. _ehead = . ;
  24. }
  25. .rodata..compressed : {
  26. *(.rodata..compressed)
  27. }
  28. .text : {
  29. _text = .; /* Text */
  30. *(.text)
  31. *(.text.*)
  32. _etext = . ;
  33. }
  34. .rodata : {
  35. _rodata = . ;
  36. *(.rodata) /* read-only data */
  37. *(.rodata.*)
  38. _erodata = . ;
  39. }
  40. .data : {
  41. _data = . ;
  42. *(.data)
  43. *(.data.*)
  44. *(.bss.efistub)
  45. _edata = . ;
  46. }
  47. . = ALIGN(L1_CACHE_BYTES);
  48. .bss : {
  49. _bss = . ;
  50. *(.bss)
  51. *(.bss.*)
  52. *(COMMON)
  53. . = ALIGN(8); /* For convenience during zeroing */
  54. _ebss = .;
  55. }
  56. #ifdef CONFIG_X86_64
  57. . = ALIGN(PAGE_SIZE);
  58. .pgtable : {
  59. _pgtable = . ;
  60. *(.pgtable)
  61. _epgtable = . ;
  62. }
  63. #endif
  64. . = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
  65. _end = .;
  66. STABS_DEBUG
  67. DWARF_DEBUG
  68. ELF_DETAILS
  69. DISCARDS
  70. /DISCARD/ : {
  71. *(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
  72. *(.hash) *(.gnu.hash)
  73. *(.note.*)
  74. }
  75. .got.plt (INFO) : {
  76. *(.got.plt)
  77. }
  78. ASSERT(SIZEOF(.got.plt) == 0 ||
  79. #ifdef CONFIG_X86_64
  80. SIZEOF(.got.plt) == 0x18,
  81. #else
  82. SIZEOF(.got.plt) == 0xc,
  83. #endif
  84. "Unexpected GOT/PLT entries detected!")
  85. /*
  86. * Sections that should stay zero sized, which is safer to
  87. * explicitly check instead of blindly discarding.
  88. */
  89. .got : {
  90. *(.got)
  91. }
  92. ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
  93. .plt : {
  94. *(.plt) *(.plt.*)
  95. }
  96. ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
  97. .rel.dyn : {
  98. *(.rel.*) *(.rel_*)
  99. }
  100. ASSERT(SIZEOF(.rel.dyn) == 0, "Unexpected run-time relocations (.rel) detected!")
  101. .rela.dyn : {
  102. *(.rela.*) *(.rela_*)
  103. }
  104. ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
  105. }