vmlinux.lds.S 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. LOCK_TEXT
  65. KPROBES_TEXT
  66. IRQENTRY_TEXT
  67. SOFTIRQENTRY_TEXT
  68. *(.text.do_softirq)
  69. *(.text.sys_exit)
  70. *(.text.do_sigaltstack)
  71. *(.text.do_fork)
  72. *(.text.*)
  73. *(.fixup)
  74. *(.lock.text) /* out-of-line lock text */
  75. *(.gnu.warning)
  76. }
  77. . = ALIGN(PAGE_SIZE);
  78. _etext = .;
  79. /* End of text section */
  80. /* Start of data section */
  81. _sdata = .;
  82. RO_DATA_SECTION(8)
  83. #ifdef CONFIG_64BIT
  84. . = ALIGN(16);
  85. /* Linkage tables */
  86. .opd : {
  87. *(.opd)
  88. } PROVIDE (__gp = .);
  89. .plt : {
  90. *(.plt)
  91. }
  92. .dlt : {
  93. *(.dlt)
  94. }
  95. #endif
  96. /* unwind info */
  97. .PARISC.unwind : {
  98. __start___unwind = .;
  99. *(.PARISC.unwind)
  100. __stop___unwind = .;
  101. }
  102. /* writeable */
  103. /* Make sure this is page aligned so
  104. * that we can properly leave these
  105. * as writable
  106. */
  107. . = ALIGN(HUGEPAGE_SIZE);
  108. data_start = .;
  109. EXCEPTION_TABLE(8)
  110. NOTES
  111. /* Data */
  112. RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
  113. /* PA-RISC locks requires 16-byte alignment */
  114. . = ALIGN(16);
  115. .data..lock_aligned : {
  116. *(.data..lock_aligned)
  117. }
  118. /* End of data section */
  119. _edata = .;
  120. /* BSS */
  121. BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
  122. /* bootmap is allocated in setup_bootmem() directly behind bss. */
  123. . = ALIGN(HUGEPAGE_SIZE);
  124. _end = . ;
  125. STABS_DEBUG
  126. .note 0 : { *(.note) }
  127. /* Sections to be discarded */
  128. DISCARDS
  129. /DISCARD/ : {
  130. #ifdef CONFIG_64BIT
  131. /* temporary hack until binutils is fixed to not emit these
  132. * for static binaries
  133. */
  134. *(.interp)
  135. *(.dynsym)
  136. *(.dynstr)
  137. *(.dynamic)
  138. *(.hash)
  139. *(.gnu.hash)
  140. #endif
  141. }
  142. }