vmlinux.lds.S 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /*
  2. * File: arch/blackfin/kernel/vmlinux.lds.S
  3. * Based on: none - original work
  4. * Author:
  5. *
  6. * Created: Tue Sep 21 2004
  7. * Description: Master linker script for blackfin architecture
  8. *
  9. * Modified:
  10. * Copyright 2004-2007 Analog Devices Inc.
  11. *
  12. * Bugs: Enter bugs at http://blackfin.uclinux.org/
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, see the file COPYING, or write
  26. * to the Free Software Foundation, Inc.,
  27. * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  28. */
  29. #define VMLINUX_SYMBOL(_sym_) _##_sym_
  30. #include <asm-generic/vmlinux.lds.h>
  31. #include <asm/mem_map.h>
  32. #include <asm/page.h>
  33. #include <asm/thread_info.h>
  34. OUTPUT_FORMAT("elf32-bfin")
  35. ENTRY(__start)
  36. _jiffies = _jiffies_64;
  37. SECTIONS
  38. {
  39. . = CONFIG_BOOT_LOAD;
  40. /* Neither the text, ro_data or bss section need to be aligned
  41. * So pack them back to back
  42. */
  43. .text :
  44. {
  45. __text = .;
  46. _text = .;
  47. __stext = .;
  48. TEXT_TEXT
  49. #ifndef CONFIG_SCHEDULE_L1
  50. SCHED_TEXT
  51. #endif
  52. LOCK_TEXT
  53. IRQENTRY_TEXT
  54. KPROBES_TEXT
  55. *(.text.*)
  56. *(.fixup)
  57. #if !L1_CODE_LENGTH
  58. *(.l1.text)
  59. #endif
  60. . = ALIGN(16);
  61. ___start___ex_table = .;
  62. *(__ex_table)
  63. ___stop___ex_table = .;
  64. __etext = .;
  65. }
  66. NOTES
  67. /* Just in case the first read only is a 32-bit access */
  68. RO_DATA(4)
  69. .bss :
  70. {
  71. . = ALIGN(4);
  72. ___bss_start = .;
  73. *(.bss .bss.*)
  74. *(COMMON)
  75. #if !L1_DATA_A_LENGTH
  76. *(.l1.bss)
  77. #endif
  78. #if !L1_DATA_B_LENGTH
  79. *(.l1.bss.B)
  80. #endif
  81. . = ALIGN(4);
  82. ___bss_stop = .;
  83. }
  84. .data :
  85. {
  86. __sdata = .;
  87. /* This gets done first, so the glob doesn't suck it in */
  88. CACHELINE_ALIGNED_DATA(32)
  89. #if !L1_DATA_A_LENGTH
  90. . = ALIGN(32);
  91. *(.data_l1.cacheline_aligned)
  92. *(.l1.data)
  93. #endif
  94. #if !L1_DATA_B_LENGTH
  95. *(.l1.data.B)
  96. #endif
  97. #if !L2_LENGTH
  98. . = ALIGN(32);
  99. *(.data_l2.cacheline_aligned)
  100. *(.l2.data)
  101. #endif
  102. DATA_DATA
  103. CONSTRUCTORS
  104. INIT_TASK_DATA(THREAD_SIZE)
  105. __edata = .;
  106. }
  107. /* The init section should be last, so when we free it, it goes into
  108. * the general memory pool, and (hopefully) will decrease fragmentation
  109. * a tiny bit. The init section has a _requirement_ that it be
  110. * PAGE_SIZE aligned
  111. */
  112. . = ALIGN(PAGE_SIZE);
  113. ___init_begin = .;
  114. INIT_TEXT_SECTION(PAGE_SIZE)
  115. . = ALIGN(16);
  116. INIT_DATA_SECTION(16)
  117. PERCPU(4)
  118. /* we have to discard exit text and such at runtime, not link time, to
  119. * handle embedded cross-section references (alt instructions, bug
  120. * table, eh_frame, etc...)
  121. */
  122. .exit.text :
  123. {
  124. EXIT_TEXT
  125. }
  126. .exit.data :
  127. {
  128. EXIT_DATA
  129. }
  130. __l1_lma_start = .;
  131. .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
  132. {
  133. . = ALIGN(4);
  134. __stext_l1 = .;
  135. *(.l1.text)
  136. #ifdef CONFIG_SCHEDULE_L1
  137. SCHED_TEXT
  138. #endif
  139. . = ALIGN(4);
  140. __etext_l1 = .;
  141. }
  142. ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
  143. .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
  144. {
  145. . = ALIGN(4);
  146. __sdata_l1 = .;
  147. *(.l1.data)
  148. __edata_l1 = .;
  149. . = ALIGN(32);
  150. *(.data_l1.cacheline_aligned)
  151. . = ALIGN(4);
  152. __sbss_l1 = .;
  153. *(.l1.bss)
  154. . = ALIGN(4);
  155. __ebss_l1 = .;
  156. }
  157. ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
  158. .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
  159. {
  160. . = ALIGN(4);
  161. __sdata_b_l1 = .;
  162. *(.l1.data.B)
  163. __edata_b_l1 = .;
  164. . = ALIGN(4);
  165. __sbss_b_l1 = .;
  166. *(.l1.bss.B)
  167. . = ALIGN(4);
  168. __ebss_b_l1 = .;
  169. }
  170. ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
  171. __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
  172. .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
  173. {
  174. . = ALIGN(4);
  175. __stext_l2 = .;
  176. *(.l2.text)
  177. . = ALIGN(4);
  178. __etext_l2 = .;
  179. . = ALIGN(4);
  180. __sdata_l2 = .;
  181. *(.l2.data)
  182. __edata_l2 = .;
  183. . = ALIGN(32);
  184. *(.data_l2.cacheline_aligned)
  185. . = ALIGN(4);
  186. __sbss_l2 = .;
  187. *(.l2.bss)
  188. . = ALIGN(4);
  189. __ebss_l2 = .;
  190. }
  191. ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!")
  192. /* Force trailing alignment of our init section so that when we
  193. * free our init memory, we don't leave behind a partial page.
  194. */
  195. . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
  196. . = ALIGN(PAGE_SIZE);
  197. ___init_end = .;
  198. __end =.;
  199. STABS_DEBUG
  200. DWARF_DEBUG
  201. DISCARDS
  202. }