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 <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. #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. KPROBES_TEXT
  80. IRQENTRY_TEXT
  81. SOFTIRQENTRY_TEXT
  82. *(.text.do_softirq)
  83. *(.text.sys_exit)
  84. *(.text.do_sigaltstack)
  85. *(.text.do_fork)
  86. *(.text.div)
  87. *($$*) /* millicode routines */
  88. *(.text.*)
  89. *(.fixup)
  90. *(.lock.text) /* out-of-line lock text */
  91. *(.gnu.warning)
  92. }
  93. MLONGCALL_KEEP(EXIT_TEXT_SECTIONS())
  94. . = ALIGN(PAGE_SIZE);
  95. _etext = .;
  96. /* End of text section */
  97. /* Start of data section */
  98. _sdata = .;
  99. /* Architecturally we need to keep __gp below 0x1000000 and thus
  100. * in front of RO_DATA() which stores lots of tracepoint
  101. * and ftrace symbols. */
  102. #ifdef CONFIG_64BIT
  103. . = ALIGN(16);
  104. /* Linkage tables */
  105. .opd : {
  106. __start_opd = .;
  107. *(.opd)
  108. __end_opd = .;
  109. } PROVIDE (__gp = .);
  110. .plt : {
  111. *(.plt)
  112. }
  113. .dlt : {
  114. *(.dlt)
  115. }
  116. #endif
  117. RO_DATA(PAGE_SIZE)
  118. /* unwind info */
  119. . = ALIGN(4);
  120. .PARISC.unwind : {
  121. __start___unwind = .;
  122. *(.PARISC.unwind)
  123. __stop___unwind = .;
  124. }
  125. /* writeable */
  126. /* Make sure this is page aligned so
  127. * that we can properly leave these
  128. * as writable
  129. */
  130. . = ALIGN(HUGEPAGE_SIZE);
  131. data_start = .;
  132. /* Data */
  133. RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
  134. /* PA-RISC locks requires 16-byte alignment */
  135. . = ALIGN(16);
  136. .data..lock_aligned : {
  137. *(.data..lock_aligned)
  138. }
  139. /* End of data section */
  140. . = ALIGN(PAGE_SIZE);
  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. }