vmlinux.lds.S 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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 <[email protected]>
  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. #define CC_USING_PATCHABLE_FUNCTION_ENTRY
  20. #define RO_EXCEPTION_TABLE_ALIGN 8
  21. #include <asm-generic/vmlinux.lds.h>
  22. /* needed for the processor specific cache alignment size */
  23. #include <asm/cache.h>
  24. #include <asm/page.h>
  25. #include <asm/asm-offsets.h>
  26. #include <asm/thread_info.h>
  27. /* ld script to make hppa Linux kernel */
  28. #ifndef CONFIG_64BIT
  29. OUTPUT_FORMAT("elf32-hppa-linux")
  30. OUTPUT_ARCH(hppa)
  31. #else
  32. OUTPUT_FORMAT("elf64-hppa-linux")
  33. OUTPUT_ARCH(hppa:hppa2.0w)
  34. #endif
  35. #define EXIT_TEXT_SECTIONS() .exit.text : { EXIT_TEXT }
  36. #if !defined(CONFIG_64BIT) || defined(CONFIG_MLONGCALLS)
  37. #define MLONGCALL_KEEP(x)
  38. #define MLONGCALL_DISCARD(x) x
  39. #else
  40. #define MLONGCALL_KEEP(x) x
  41. #define MLONGCALL_DISCARD(x)
  42. #endif
  43. ENTRY(parisc_kernel_start)
  44. #ifndef CONFIG_64BIT
  45. jiffies = jiffies_64 + 4;
  46. #else
  47. jiffies = jiffies_64;
  48. #endif
  49. SECTIONS
  50. {
  51. . = KERNEL_BINARY_TEXT_START;
  52. __init_begin = .;
  53. HEAD_TEXT_SECTION
  54. MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
  55. . = ALIGN(PAGE_SIZE);
  56. INIT_DATA_SECTION(PAGE_SIZE)
  57. MLONGCALL_DISCARD(EXIT_TEXT_SECTIONS())
  58. .exit.data :
  59. {
  60. EXIT_DATA
  61. }
  62. PERCPU_SECTION(8)
  63. . = ALIGN(4);
  64. .altinstructions : {
  65. __alt_instructions = .;
  66. *(.altinstructions)
  67. __alt_instructions_end = .;
  68. }
  69. . = ALIGN(HUGEPAGE_SIZE);
  70. __init_end = .;
  71. /* freed after init ends here */
  72. _text = .; /* Text and read-only data */
  73. _stext = .;
  74. MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
  75. .text ALIGN(PAGE_SIZE) : {
  76. TEXT_TEXT
  77. LOCK_TEXT
  78. SCHED_TEXT
  79. CPUIDLE_TEXT
  80. KPROBES_TEXT
  81. IRQENTRY_TEXT
  82. SOFTIRQENTRY_TEXT
  83. *(.text.do_softirq)
  84. *(.text.sys_exit)
  85. *(.text.do_sigaltstack)
  86. *(.text.do_fork)
  87. *(.text.div)
  88. *($$*) /* millicode routines */
  89. *(.text.*)
  90. *(.fixup)
  91. *(.lock.text) /* out-of-line lock text */
  92. *(.gnu.warning)
  93. }
  94. MLONGCALL_KEEP(EXIT_TEXT_SECTIONS())
  95. . = ALIGN(PAGE_SIZE);
  96. _etext = .;
  97. /* End of text section */
  98. /* Start of data section */
  99. _sdata = .;
  100. /* Architecturally we need to keep __gp below 0x1000000 and thus
  101. * in front of RO_DATA() which stores lots of tracepoint
  102. * and ftrace symbols. */
  103. #ifdef CONFIG_64BIT
  104. . = ALIGN(16);
  105. /* Linkage tables */
  106. .opd : {
  107. __start_opd = .;
  108. *(.opd)
  109. __end_opd = .;
  110. } PROVIDE (__gp = .);
  111. .plt : {
  112. *(.plt)
  113. }
  114. .dlt : {
  115. *(.dlt)
  116. }
  117. #endif
  118. RO_DATA(8)
  119. /* unwind info */
  120. . = ALIGN(4);
  121. .PARISC.unwind : {
  122. __start___unwind = .;
  123. *(.PARISC.unwind)
  124. __stop___unwind = .;
  125. }
  126. /* writeable */
  127. /* Make sure this is page aligned so
  128. * that we can properly leave these
  129. * as writable
  130. */
  131. . = ALIGN(HUGEPAGE_SIZE);
  132. data_start = .;
  133. /* Data */
  134. RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
  135. /* PA-RISC locks requires 16-byte alignment */
  136. . = ALIGN(16);
  137. .data..lock_aligned : {
  138. *(.data..lock_aligned)
  139. }
  140. /* End of data section */
  141. _edata = .;
  142. /* BSS */
  143. BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
  144. . = ALIGN(HUGEPAGE_SIZE);
  145. _end = . ;
  146. STABS_DEBUG
  147. ELF_DETAILS
  148. .note 0 : { *(.note) }
  149. /* Sections to be discarded */
  150. DISCARDS
  151. /DISCARD/ : {
  152. #ifdef CONFIG_64BIT
  153. /* temporary hack until binutils is fixed to not emit these
  154. * for static binaries
  155. */
  156. *(.interp)
  157. *(.dynsym)
  158. *(.dynstr)
  159. *(.dynamic)
  160. *(.hash)
  161. *(.gnu.hash)
  162. #endif
  163. }
  164. }