vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Kernel link layout for various "sections"
  3. *
  4. * Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
  5. * Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
  6. * Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
  7. * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
  8. * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
  9. * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
  10. * Copyright (C) 2006-2013 Helge Deller <deller@gmx.de>
  11. */
  12. /*
  13. * Put page table entries (swapper_pg_dir) as the first thing in .bss. This
  14. * will ensure that it has .bss alignment (PAGE_SIZE).
  15. */
  16. #define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \
  17. *(.data..vm0.pgd) \
  18. *(.data..vm0.pte)
  19. #include <asm-generic/vmlinux.lds.h>
  20. /* needed for the processor specific cache alignment size */
  21. #include <asm/cache.h>
  22. #include <asm/page.h>
  23. #include <asm/asm-offsets.h>
  24. #include <asm/thread_info.h>
  25. /* ld script to make hppa Linux kernel */
  26. #ifndef CONFIG_64BIT
  27. OUTPUT_FORMAT("elf32-hppa-linux")
  28. OUTPUT_ARCH(hppa)
  29. #else
  30. OUTPUT_FORMAT("elf64-hppa-linux")
  31. OUTPUT_ARCH(hppa:hppa2.0w)
  32. #endif
  33. ENTRY(parisc_kernel_start)
  34. #ifndef CONFIG_64BIT
  35. jiffies = jiffies_64 + 4;
  36. #else
  37. jiffies = jiffies_64;
  38. #endif
  39. SECTIONS
  40. {
  41. . = KERNEL_BINARY_TEXT_START;
  42. __init_begin = .;
  43. HEAD_TEXT_SECTION
  44. INIT_TEXT_SECTION(8)
  45. . = ALIGN(PAGE_SIZE);
  46. INIT_DATA_SECTION(PAGE_SIZE)
  47. /* we have to discard exit text and such at runtime, not link time */
  48. .exit.text :
  49. {
  50. EXIT_TEXT
  51. }
  52. .exit.data :
  53. {
  54. EXIT_DATA
  55. }
  56. PERCPU_SECTION(8)
  57. . = ALIGN(4);
  58. .altinstructions : {
  59. __alt_instructions = .;
  60. *(.altinstructions)
  61. __alt_instructions_end = .;
  62. }
  63. . = ALIGN(HUGEPAGE_SIZE);
  64. __init_end = .;
  65. /* freed after init ends here */
  66. _text = .; /* Text and read-only data */
  67. _stext = .;
  68. .text ALIGN(PAGE_SIZE) : {
  69. TEXT_TEXT
  70. SCHED_TEXT
  71. CPUIDLE_TEXT
  72. LOCK_TEXT
  73. KPROBES_TEXT
  74. IRQENTRY_TEXT
  75. SOFTIRQENTRY_TEXT
  76. *(.text.do_softirq)
  77. *(.text.sys_exit)
  78. *(.text.do_sigaltstack)
  79. *(.text.do_fork)
  80. *(.text.div)
  81. *($$*) /* millicode routines */
  82. *(.text.*)
  83. *(.fixup)
  84. *(.lock.text) /* out-of-line lock text */
  85. *(.gnu.warning)
  86. }
  87. . = ALIGN(PAGE_SIZE);
  88. _etext = .;
  89. /* End of text section */
  90. /* Start of data section */
  91. _sdata = .;
  92. /* Architecturally we need to keep __gp below 0x1000000 and thus
  93. * in front of RO_DATA_SECTION() which stores lots of tracepoint
  94. * and ftrace symbols. */
  95. #ifdef CONFIG_64BIT
  96. . = ALIGN(16);
  97. /* Linkage tables */
  98. .opd : {
  99. __start_opd = .;
  100. *(.opd)
  101. __end_opd = .;
  102. } PROVIDE (__gp = .);
  103. .plt : {
  104. *(.plt)
  105. }
  106. .dlt : {
  107. *(.dlt)
  108. }
  109. #endif
  110. RO_DATA_SECTION(8)
  111. /* RO because of BUILDTIME_EXTABLE_SORT */
  112. EXCEPTION_TABLE(8)
  113. NOTES
  114. /* unwind info */
  115. .PARISC.unwind : {
  116. __start___unwind = .;
  117. *(.PARISC.unwind)
  118. __stop___unwind = .;
  119. }
  120. /* writeable */
  121. /* Make sure this is page aligned so
  122. * that we can properly leave these
  123. * as writable
  124. */
  125. . = ALIGN(HUGEPAGE_SIZE);
  126. data_start = .;
  127. /* Data */
  128. RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
  129. /* PA-RISC locks requires 16-byte alignment */
  130. . = ALIGN(16);
  131. .data..lock_aligned : {
  132. *(.data..lock_aligned)
  133. }
  134. /* End of data section */
  135. _edata = .;
  136. /* BSS */
  137. BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
  138. . = ALIGN(HUGEPAGE_SIZE);
  139. _end = . ;
  140. STABS_DEBUG
  141. .note 0 : { *(.note) }
  142. /* Sections to be discarded */
  143. DISCARDS
  144. /DISCARD/ : {
  145. #ifdef CONFIG_64BIT
  146. /* temporary hack until binutils is fixed to not emit these
  147. * for static binaries
  148. */
  149. *(.interp)
  150. *(.dynsym)
  151. *(.dynstr)
  152. *(.dynamic)
  153. *(.hash)
  154. *(.gnu.hash)
  155. #endif
  156. }
  157. }