vmlinux.lds.S 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. /* Kernel link layout for various "sections"
  2. *
  3. * Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
  4. * Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
  5. * Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
  6. * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
  7. * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
  8. * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
  9. * Copyright (C) 2006 Helge Deller <deller@gmx.de>
  10. *
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25. */
  26. #include <asm-generic/vmlinux.lds.h>
  27. /* needed for the processor specific cache alignment size */
  28. #include <asm/cache.h>
  29. #include <asm/page.h>
  30. #include <asm/asm-offsets.h>
  31. /* ld script to make hppa Linux kernel */
  32. #ifndef CONFIG_64BIT
  33. OUTPUT_FORMAT("elf32-hppa-linux")
  34. OUTPUT_ARCH(hppa)
  35. #else
  36. OUTPUT_FORMAT("elf64-hppa-linux")
  37. OUTPUT_ARCH(hppa:hppa2.0w)
  38. #endif
  39. ENTRY(_stext)
  40. #ifndef CONFIG_64BIT
  41. jiffies = jiffies_64 + 4;
  42. #else
  43. jiffies = jiffies_64;
  44. #endif
  45. SECTIONS
  46. {
  47. . = KERNEL_BINARY_TEXT_START;
  48. _text = .; /* Text and read-only data */
  49. .text ALIGN(16) : {
  50. HEAD_TEXT
  51. TEXT_TEXT
  52. SCHED_TEXT
  53. LOCK_TEXT
  54. KPROBES_TEXT
  55. IRQENTRY_TEXT
  56. *(.text.do_softirq)
  57. *(.text.sys_exit)
  58. *(.text.do_sigaltstack)
  59. *(.text.do_fork)
  60. *(.text.*)
  61. *(.fixup)
  62. *(.lock.text) /* out-of-line lock text */
  63. *(.gnu.warning)
  64. } = 0
  65. /* End of text section */
  66. _etext = .;
  67. RODATA
  68. /* writeable */
  69. /* Make sure this is page aligned so
  70. * that we can properly leave these
  71. * as writable
  72. */
  73. . = ALIGN(PAGE_SIZE);
  74. data_start = .;
  75. . = ALIGN(16);
  76. /* Exception table */
  77. __ex_table : {
  78. __start___ex_table = .;
  79. *(__ex_table)
  80. __stop___ex_table = .;
  81. }
  82. NOTES
  83. /* unwind info */
  84. .PARISC.unwind : {
  85. __start___unwind = .;
  86. *(.PARISC.unwind)
  87. __stop___unwind = .;
  88. }
  89. /* rarely changed data like cpu maps */
  90. . = ALIGN(16);
  91. .data.read_mostly : {
  92. *(.data.read_mostly)
  93. }
  94. . = ALIGN(L1_CACHE_BYTES);
  95. /* Data */
  96. .data : {
  97. DATA_DATA
  98. CONSTRUCTORS
  99. }
  100. . = ALIGN(L1_CACHE_BYTES);
  101. .data.cacheline_aligned : {
  102. *(.data.cacheline_aligned)
  103. }
  104. /* PA-RISC locks requires 16-byte alignment */
  105. . = ALIGN(16);
  106. .data.lock_aligned : {
  107. *(.data.lock_aligned)
  108. }
  109. /* nosave data is really only used for software suspend...it's here
  110. * just in case we ever implement it
  111. */
  112. . = ALIGN(PAGE_SIZE);
  113. __nosave_begin = .;
  114. .data_nosave : {
  115. *(.data.nosave)
  116. }
  117. . = ALIGN(PAGE_SIZE);
  118. __nosave_end = .;
  119. /* End of data section */
  120. _edata = .;
  121. /* BSS */
  122. __bss_start = .;
  123. /* page table entries need to be PAGE_SIZE aligned */
  124. . = ALIGN(PAGE_SIZE);
  125. .data.vmpages : {
  126. *(.data.vm0.pmd)
  127. *(.data.vm0.pgd)
  128. *(.data.vm0.pte)
  129. }
  130. .bss : {
  131. *(.bss)
  132. *(COMMON)
  133. }
  134. __bss_stop = .;
  135. /* assembler code expects init_task to be 16k aligned */
  136. . = ALIGN(16384);
  137. /* init_task */
  138. .data.init_task : {
  139. *(.data.init_task)
  140. }
  141. #ifdef CONFIG_64BIT
  142. . = ALIGN(16);
  143. /* Linkage tables */
  144. .opd : {
  145. *(.opd)
  146. } PROVIDE (__gp = .);
  147. .plt : {
  148. *(.plt)
  149. }
  150. .dlt : {
  151. *(.dlt)
  152. }
  153. #endif
  154. /* reserve space for interrupt stack by aligning __init* to 16k */
  155. . = ALIGN(16384);
  156. __init_begin = .;
  157. .init.text : {
  158. _sinittext = .;
  159. INIT_TEXT
  160. _einittext = .;
  161. }
  162. .init.data : {
  163. INIT_DATA
  164. }
  165. . = ALIGN(16);
  166. .init.setup : {
  167. __setup_start = .;
  168. *(.init.setup)
  169. __setup_end = .;
  170. }
  171. .initcall.init : {
  172. __initcall_start = .;
  173. INITCALLS
  174. __initcall_end = .;
  175. }
  176. .con_initcall.init : {
  177. __con_initcall_start = .;
  178. *(.con_initcall.init)
  179. __con_initcall_end = .;
  180. }
  181. SECURITY_INIT
  182. /* alternate instruction replacement. This is a mechanism x86 uses
  183. * to detect the CPU type and replace generic instruction sequences
  184. * with CPU specific ones. We don't currently do this in PA, but
  185. * it seems like a good idea...
  186. */
  187. . = ALIGN(4);
  188. .altinstructions : {
  189. __alt_instructions = .;
  190. *(.altinstructions)
  191. __alt_instructions_end = .;
  192. }
  193. .altinstr_replacement : {
  194. *(.altinstr_replacement)
  195. }
  196. /* .exit.text is discard at runtime, not link time, to deal with references
  197. * from .altinstructions and .eh_frame
  198. */
  199. .exit.text : {
  200. EXIT_TEXT
  201. }
  202. .exit.data : {
  203. EXIT_DATA
  204. }
  205. #ifdef CONFIG_BLK_DEV_INITRD
  206. . = ALIGN(PAGE_SIZE);
  207. .init.ramfs : {
  208. __initramfs_start = .;
  209. *(.init.ramfs)
  210. __initramfs_end = .;
  211. }
  212. #endif
  213. PERCPU(PAGE_SIZE)
  214. . = ALIGN(PAGE_SIZE);
  215. __init_end = .;
  216. /* freed after init ends here */
  217. _end = . ;
  218. /* Sections to be discarded */
  219. /DISCARD/ : {
  220. *(.exitcall.exit)
  221. #ifdef CONFIG_64BIT
  222. /* temporary hack until binutils is fixed to not emit these
  223. * for static binaries
  224. */
  225. *(.interp)
  226. *(.dynsym)
  227. *(.dynstr)
  228. *(.dynamic)
  229. *(.hash)
  230. *(.gnu.hash)
  231. #endif
  232. }
  233. STABS_DEBUG
  234. .note 0 : { *(.note) }
  235. }