vmlinux.lds.S 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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-2013 Helge Deller <deller@gmx.de>
  10. */
  11. /*
  12. * Put page table entries (swapper_pg_dir) as the first thing in .bss. This
  13. * will ensure that it has .bss alignment (PAGE_SIZE).
  14. */
  15. #define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \
  16. *(.data..vm0.pgd) \
  17. *(.data..vm0.pte)
  18. #include <asm-generic/vmlinux.lds.h>
  19. /* needed for the processor specific cache alignment size */
  20. #include <asm/cache.h>
  21. #include <asm/page.h>
  22. #include <asm/asm-offsets.h>
  23. #include <asm/thread_info.h>
  24. /* ld script to make hppa Linux kernel */
  25. #ifndef CONFIG_64BIT
  26. OUTPUT_FORMAT("elf32-hppa-linux")
  27. OUTPUT_ARCH(hppa)
  28. #else
  29. OUTPUT_FORMAT("elf64-hppa-linux")
  30. OUTPUT_ARCH(hppa:hppa2.0w)
  31. #endif
  32. ENTRY(parisc_kernel_start)
  33. #ifndef CONFIG_64BIT
  34. jiffies = jiffies_64 + 4;
  35. #else
  36. jiffies = jiffies_64;
  37. #endif
  38. SECTIONS
  39. {
  40. . = KERNEL_BINARY_TEXT_START;
  41. __init_begin = .;
  42. HEAD_TEXT_SECTION
  43. INIT_TEXT_SECTION(8)
  44. . = ALIGN(PAGE_SIZE);
  45. INIT_DATA_SECTION(PAGE_SIZE)
  46. /* we have to discard exit text and such at runtime, not link time */
  47. .exit.text :
  48. {
  49. EXIT_TEXT
  50. }
  51. .exit.data :
  52. {
  53. EXIT_DATA
  54. }
  55. PERCPU_SECTION(8)
  56. . = ALIGN(HUGEPAGE_SIZE);
  57. __init_end = .;
  58. /* freed after init ends here */
  59. _text = .; /* Text and read-only data */
  60. _stext = .;
  61. .text ALIGN(PAGE_SIZE) : {
  62. TEXT_TEXT
  63. SCHED_TEXT
  64. CPUIDLE_TEXT
  65. LOCK_TEXT
  66. KPROBES_TEXT
  67. IRQENTRY_TEXT
  68. SOFTIRQENTRY_TEXT
  69. *(.text.do_softirq)
  70. *(.text.sys_exit)
  71. *(.text.do_sigaltstack)
  72. *(.text.do_fork)
  73. *(.text.*)
  74. *(.fixup)
  75. *(.lock.text) /* out-of-line lock text */
  76. *(.gnu.warning)
  77. }
  78. . = ALIGN(PAGE_SIZE);
  79. _etext = .;
  80. /* End of text section */
  81. /* Start of data section */
  82. _sdata = .;
  83. /* Architecturally we need to keep __gp below 0x1000000 and thus
  84. * in front of RO_DATA_SECTION() which stores lots of tracepoint
  85. * and ftrace symbols. */
  86. #ifdef CONFIG_64BIT
  87. . = ALIGN(16);
  88. /* Linkage tables */
  89. .opd : {
  90. *(.opd)
  91. } PROVIDE (__gp = .);
  92. .plt : {
  93. *(.plt)
  94. }
  95. .dlt : {
  96. *(.dlt)
  97. }
  98. #endif
  99. RO_DATA_SECTION(8)
  100. /* RO because of BUILDTIME_EXTABLE_SORT */
  101. EXCEPTION_TABLE(8)
  102. NOTES
  103. /* unwind info */
  104. .PARISC.unwind : {
  105. __start___unwind = .;
  106. *(.PARISC.unwind)
  107. __stop___unwind = .;
  108. }
  109. /* writeable */
  110. /* Make sure this is page aligned so
  111. * that we can properly leave these
  112. * as writable
  113. */
  114. . = ALIGN(HUGEPAGE_SIZE);
  115. data_start = .;
  116. /* Data */
  117. RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
  118. /* PA-RISC locks requires 16-byte alignment */
  119. . = ALIGN(16);
  120. .data..lock_aligned : {
  121. *(.data..lock_aligned)
  122. }
  123. /* End of data section */
  124. _edata = .;
  125. /* BSS */
  126. BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
  127. . = ALIGN(HUGEPAGE_SIZE);
  128. _end = . ;
  129. STABS_DEBUG
  130. .note 0 : { *(.note) }
  131. /* Sections to be discarded */
  132. DISCARDS
  133. /DISCARD/ : {
  134. #ifdef CONFIG_64BIT
  135. /* temporary hack until binutils is fixed to not emit these
  136. * for static binaries
  137. */
  138. *(.interp)
  139. *(.dynsym)
  140. *(.dynstr)
  141. *(.dynamic)
  142. *(.hash)
  143. *(.gnu.hash)
  144. #endif
  145. }
  146. }