vmlinux.lds.S 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. EXCEPTION_TABLE(16)
  76. NOTES
  77. /* unwind info */
  78. .PARISC.unwind : {
  79. __start___unwind = .;
  80. *(.PARISC.unwind)
  81. __stop___unwind = .;
  82. }
  83. /* Data */
  84. RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
  85. /* PA-RISC locks requires 16-byte alignment */
  86. . = ALIGN(16);
  87. .data.lock_aligned : {
  88. *(.data.lock_aligned)
  89. }
  90. /* End of data section */
  91. _edata = .;
  92. /* BSS */
  93. __bss_start = .;
  94. /* page table entries need to be PAGE_SIZE aligned */
  95. . = ALIGN(PAGE_SIZE);
  96. .data.vmpages : {
  97. *(.data.vm0.pmd)
  98. *(.data.vm0.pgd)
  99. *(.data.vm0.pte)
  100. }
  101. .bss : {
  102. *(.bss)
  103. *(COMMON)
  104. }
  105. __bss_stop = .;
  106. #ifdef CONFIG_64BIT
  107. . = ALIGN(16);
  108. /* Linkage tables */
  109. .opd : {
  110. *(.opd)
  111. } PROVIDE (__gp = .);
  112. .plt : {
  113. *(.plt)
  114. }
  115. .dlt : {
  116. *(.dlt)
  117. }
  118. #endif
  119. /* reserve space for interrupt stack by aligning __init* to 16k */
  120. . = ALIGN(16384);
  121. __init_begin = .;
  122. INIT_TEXT_SECTION(16384)
  123. INIT_DATA_SECTION(16)
  124. /* alternate instruction replacement. This is a mechanism x86 uses
  125. * to detect the CPU type and replace generic instruction sequences
  126. * with CPU specific ones. We don't currently do this in PA, but
  127. * it seems like a good idea...
  128. */
  129. . = ALIGN(4);
  130. .altinstructions : {
  131. __alt_instructions = .;
  132. *(.altinstructions)
  133. __alt_instructions_end = .;
  134. }
  135. .altinstr_replacement : {
  136. *(.altinstr_replacement)
  137. }
  138. /* .exit.text is discard at runtime, not link time, to deal with references
  139. * from .altinstructions and .eh_frame
  140. */
  141. .exit.text : {
  142. EXIT_TEXT
  143. }
  144. .exit.data : {
  145. EXIT_DATA
  146. }
  147. PERCPU(PAGE_SIZE)
  148. . = ALIGN(PAGE_SIZE);
  149. __init_end = .;
  150. /* freed after init ends here */
  151. _end = . ;
  152. STABS_DEBUG
  153. .note 0 : { *(.note) }
  154. /* Sections to be discarded */
  155. DISCARDS
  156. /DISCARD/ : {
  157. #ifdef CONFIG_64BIT
  158. /* temporary hack until binutils is fixed to not emit these
  159. * for static binaries
  160. */
  161. *(.interp)
  162. *(.dynsym)
  163. *(.dynstr)
  164. *(.dynamic)
  165. *(.hash)
  166. *(.gnu.hash)
  167. #endif
  168. }
  169. }