vmlinux.lds.S 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. TEXT_TEXT
  51. SCHED_TEXT
  52. LOCK_TEXT
  53. *(.text.do_softirq)
  54. *(.text.sys_exit)
  55. *(.text.do_sigaltstack)
  56. *(.text.do_fork)
  57. *(.text.*)
  58. *(.fixup)
  59. *(.lock.text) /* out-of-line lock text */
  60. *(.gnu.warning)
  61. } = 0
  62. /* End of text section */
  63. _etext = .;
  64. RODATA
  65. /* writeable */
  66. /* Make sure this is page aligned so
  67. * that we can properly leave these
  68. * as writable
  69. */
  70. . = ALIGN(PAGE_SIZE);
  71. data_start = .;
  72. . = ALIGN(16);
  73. /* Exception table */
  74. __ex_table : {
  75. __start___ex_table = .;
  76. *(__ex_table)
  77. __stop___ex_table = .;
  78. }
  79. NOTES
  80. /* unwind info */
  81. .PARISC.unwind : {
  82. __start___unwind = .;
  83. *(.PARISC.unwind)
  84. __stop___unwind = .;
  85. }
  86. /* rarely changed data like cpu maps */
  87. . = ALIGN(16);
  88. .data.read_mostly : {
  89. *(.data.read_mostly)
  90. }
  91. . = ALIGN(L1_CACHE_BYTES);
  92. /* Data */
  93. .data : {
  94. DATA_DATA
  95. CONSTRUCTORS
  96. }
  97. . = ALIGN(L1_CACHE_BYTES);
  98. .data.cacheline_aligned : {
  99. *(.data.cacheline_aligned)
  100. }
  101. /* PA-RISC locks requires 16-byte alignment */
  102. . = ALIGN(16);
  103. .data.lock_aligned : {
  104. *(.data.lock_aligned)
  105. }
  106. /* nosave data is really only used for software suspend...it's here
  107. * just in case we ever implement it
  108. */
  109. . = ALIGN(PAGE_SIZE);
  110. __nosave_begin = .;
  111. .data_nosave : {
  112. *(.data.nosave)
  113. }
  114. . = ALIGN(PAGE_SIZE);
  115. __nosave_end = .;
  116. /* End of data section */
  117. _edata = .;
  118. /* BSS */
  119. __bss_start = .;
  120. /* page table entries need to be PAGE_SIZE aligned */
  121. . = ALIGN(PAGE_SIZE);
  122. .data.vmpages : {
  123. *(.data.vm0.pmd)
  124. *(.data.vm0.pgd)
  125. *(.data.vm0.pte)
  126. }
  127. .bss : {
  128. *(.bss)
  129. *(COMMON)
  130. }
  131. __bss_stop = .;
  132. /* assembler code expects init_task to be 16k aligned */
  133. . = ALIGN(16384);
  134. /* init_task */
  135. .data.init_task : {
  136. *(.data.init_task)
  137. }
  138. #ifdef CONFIG_64BIT
  139. . = ALIGN(16);
  140. /* Linkage tables */
  141. .opd : {
  142. *(.opd)
  143. } PROVIDE (__gp = .);
  144. .plt : {
  145. *(.plt)
  146. }
  147. .dlt : {
  148. *(.dlt)
  149. }
  150. #endif
  151. /* reserve space for interrupt stack by aligning __init* to 16k */
  152. . = ALIGN(16384);
  153. __init_begin = .;
  154. .init.text : {
  155. _sinittext = .;
  156. INIT_TEXT
  157. _einittext = .;
  158. }
  159. .init.data : {
  160. INIT_DATA
  161. }
  162. . = ALIGN(16);
  163. .init.setup : {
  164. __setup_start = .;
  165. *(.init.setup)
  166. __setup_end = .;
  167. }
  168. .initcall.init : {
  169. __initcall_start = .;
  170. INITCALLS
  171. __initcall_end = .;
  172. }
  173. .con_initcall.init : {
  174. __con_initcall_start = .;
  175. *(.con_initcall.init)
  176. __con_initcall_end = .;
  177. }
  178. SECURITY_INIT
  179. /* alternate instruction replacement. This is a mechanism x86 uses
  180. * to detect the CPU type and replace generic instruction sequences
  181. * with CPU specific ones. We don't currently do this in PA, but
  182. * it seems like a good idea...
  183. */
  184. . = ALIGN(4);
  185. .altinstructions : {
  186. __alt_instructions = .;
  187. *(.altinstructions)
  188. __alt_instructions_end = .;
  189. }
  190. .altinstr_replacement : {
  191. *(.altinstr_replacement)
  192. }
  193. /* .exit.text is discard at runtime, not link time, to deal with references
  194. * from .altinstructions and .eh_frame
  195. */
  196. .exit.text : {
  197. EXIT_TEXT
  198. }
  199. .exit.data : {
  200. EXIT_DATA
  201. }
  202. #ifdef CONFIG_BLK_DEV_INITRD
  203. . = ALIGN(PAGE_SIZE);
  204. .init.ramfs : {
  205. __initramfs_start = .;
  206. *(.init.ramfs)
  207. __initramfs_end = .;
  208. }
  209. #endif
  210. PERCPU(PAGE_SIZE)
  211. . = ALIGN(PAGE_SIZE);
  212. __init_end = .;
  213. /* freed after init ends here */
  214. _end = . ;
  215. /* Sections to be discarded */
  216. /DISCARD/ : {
  217. *(.exitcall.exit)
  218. #ifdef CONFIG_64BIT
  219. /* temporary hack until binutils is fixed to not emit these
  220. * for static binaries
  221. */
  222. *(.interp)
  223. *(.dynsym)
  224. *(.dynstr)
  225. *(.dynamic)
  226. *(.hash)
  227. *(.gnu.hash)
  228. #endif
  229. }
  230. STABS_DEBUG
  231. .note 0 : { *(.note) }
  232. }