vmlinux.lds.S 3.5 KB

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