vmlinux.lds.S 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /*
  2. * Copyright 2004-2009 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2 or later
  5. */
  6. #include <asm-generic/vmlinux.lds.h>
  7. #include <asm/mem_map.h>
  8. #include <asm/page.h>
  9. #include <asm/thread_info.h>
  10. OUTPUT_FORMAT("elf32-bfin")
  11. ENTRY(__start)
  12. _jiffies = _jiffies_64;
  13. SECTIONS
  14. {
  15. #ifdef CONFIG_RAMKERNEL
  16. . = CONFIG_BOOT_LOAD;
  17. #else
  18. . = CONFIG_ROM_BASE;
  19. #endif
  20. /* Neither the text, ro_data or bss section need to be aligned
  21. * So pack them back to back
  22. */
  23. .text :
  24. {
  25. __text = .;
  26. _text = .;
  27. __stext = .;
  28. TEXT_TEXT
  29. #ifndef CONFIG_SCHEDULE_L1
  30. SCHED_TEXT
  31. #endif
  32. LOCK_TEXT
  33. IRQENTRY_TEXT
  34. KPROBES_TEXT
  35. #ifdef CONFIG_ROMKERNEL
  36. __sinittext = .;
  37. INIT_TEXT
  38. __einittext = .;
  39. EXIT_TEXT
  40. #endif
  41. *(.text.*)
  42. *(.fixup)
  43. #if !L1_CODE_LENGTH
  44. *(.l1.text)
  45. #endif
  46. __etext = .;
  47. }
  48. EXCEPTION_TABLE(4)
  49. NOTES
  50. /* Just in case the first read only is a 32-bit access */
  51. RO_DATA(4)
  52. __rodata_end = .;
  53. #ifdef CONFIG_ROMKERNEL
  54. . = CONFIG_BOOT_LOAD;
  55. .bss : AT(__rodata_end)
  56. #else
  57. .bss :
  58. #endif
  59. {
  60. . = ALIGN(4);
  61. ___bss_start = .;
  62. *(.bss .bss.*)
  63. *(COMMON)
  64. #if !L1_DATA_A_LENGTH
  65. *(.l1.bss)
  66. #endif
  67. #if !L1_DATA_B_LENGTH
  68. *(.l1.bss.B)
  69. #endif
  70. . = ALIGN(4);
  71. ___bss_stop = .;
  72. }
  73. #if defined(CONFIG_ROMKERNEL)
  74. .data : AT(LOADADDR(.bss) + SIZEOF(.bss))
  75. #else
  76. .data :
  77. #endif
  78. {
  79. __sdata = .;
  80. /* This gets done first, so the glob doesn't suck it in */
  81. CACHELINE_ALIGNED_DATA(32)
  82. #if !L1_DATA_A_LENGTH
  83. . = ALIGN(32);
  84. *(.data_l1.cacheline_aligned)
  85. *(.l1.data)
  86. #endif
  87. #if !L1_DATA_B_LENGTH
  88. *(.l1.data.B)
  89. #endif
  90. #if !L2_LENGTH
  91. . = ALIGN(32);
  92. *(.data_l2.cacheline_aligned)
  93. *(.l2.data)
  94. #endif
  95. DATA_DATA
  96. CONSTRUCTORS
  97. INIT_TASK_DATA(THREAD_SIZE)
  98. __edata = .;
  99. }
  100. __data_lma = LOADADDR(.data);
  101. __data_len = SIZEOF(.data);
  102. /* The init section should be last, so when we free it, it goes into
  103. * the general memory pool, and (hopefully) will decrease fragmentation
  104. * a tiny bit. The init section has a _requirement_ that it be
  105. * PAGE_SIZE aligned
  106. */
  107. . = ALIGN(PAGE_SIZE);
  108. ___init_begin = .;
  109. #ifdef CONFIG_RAMKERNEL
  110. INIT_TEXT_SECTION(PAGE_SIZE)
  111. /* We have to discard exit text and such at runtime, not link time, to
  112. * handle embedded cross-section references (alt instructions, bug
  113. * table, eh_frame, etc...). We need all of our .text up front and
  114. * .data after it for PCREL call issues.
  115. */
  116. .exit.text :
  117. {
  118. EXIT_TEXT
  119. }
  120. . = ALIGN(16);
  121. INIT_DATA_SECTION(16)
  122. PERCPU(32, PAGE_SIZE)
  123. .exit.data :
  124. {
  125. EXIT_DATA
  126. }
  127. .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
  128. #else
  129. .init.data : AT(__data_lma + __data_len)
  130. {
  131. __sinitdata = .;
  132. INIT_DATA
  133. INIT_SETUP(16)
  134. INIT_CALLS
  135. CON_INITCALL
  136. SECURITY_INITCALL
  137. INIT_RAM_FS
  138. . = ALIGN(4);
  139. ___per_cpu_load = .;
  140. ___per_cpu_start = .;
  141. *(.data.percpu.first)
  142. *(.data.percpu.page_aligned)
  143. *(.data.percpu)
  144. *(.data.percpu.shared_aligned)
  145. ___per_cpu_end = .;
  146. EXIT_DATA
  147. __einitdata = .;
  148. }
  149. __init_data_lma = LOADADDR(.init.data);
  150. __init_data_len = SIZEOF(.init.data);
  151. __init_data_end = .;
  152. .text_l1 L1_CODE_START : AT(__init_data_lma + __init_data_len)
  153. #endif
  154. {
  155. . = ALIGN(4);
  156. __stext_l1 = .;
  157. *(.l1.text.head)
  158. *(.l1.text)
  159. #ifdef CONFIG_SCHEDULE_L1
  160. SCHED_TEXT
  161. #endif
  162. . = ALIGN(4);
  163. __etext_l1 = .;
  164. }
  165. __text_l1_lma = LOADADDR(.text_l1);
  166. __text_l1_len = SIZEOF(.text_l1);
  167. ASSERT (__text_l1_len <= L1_CODE_LENGTH, "L1 text overflow!")
  168. .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len)
  169. {
  170. . = ALIGN(4);
  171. __sdata_l1 = .;
  172. *(.l1.data)
  173. __edata_l1 = .;
  174. . = ALIGN(32);
  175. *(.data_l1.cacheline_aligned)
  176. . = ALIGN(4);
  177. __sbss_l1 = .;
  178. *(.l1.bss)
  179. . = ALIGN(4);
  180. __ebss_l1 = .;
  181. }
  182. __data_l1_lma = LOADADDR(.data_l1);
  183. __data_l1_len = SIZEOF(.data_l1);
  184. ASSERT (__data_l1_len <= L1_DATA_A_LENGTH, "L1 data A overflow!")
  185. .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len)
  186. {
  187. . = ALIGN(4);
  188. __sdata_b_l1 = .;
  189. *(.l1.data.B)
  190. __edata_b_l1 = .;
  191. . = ALIGN(4);
  192. __sbss_b_l1 = .;
  193. *(.l1.bss.B)
  194. . = ALIGN(4);
  195. __ebss_b_l1 = .;
  196. }
  197. __data_b_l1_lma = LOADADDR(.data_b_l1);
  198. __data_b_l1_len = SIZEOF(.data_b_l1);
  199. ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!")
  200. .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len)
  201. {
  202. . = ALIGN(4);
  203. __stext_l2 = .;
  204. *(.l2.text)
  205. . = ALIGN(4);
  206. __etext_l2 = .;
  207. . = ALIGN(4);
  208. __sdata_l2 = .;
  209. *(.l2.data)
  210. __edata_l2 = .;
  211. . = ALIGN(32);
  212. *(.data_l2.cacheline_aligned)
  213. . = ALIGN(4);
  214. __sbss_l2 = .;
  215. *(.l2.bss)
  216. . = ALIGN(4);
  217. __ebss_l2 = .;
  218. }
  219. __l2_lma = LOADADDR(.text_data_l2);
  220. __l2_len = SIZEOF(.text_data_l2);
  221. ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!")
  222. /* Force trailing alignment of our init section so that when we
  223. * free our init memory, we don't leave behind a partial page.
  224. */
  225. #ifdef CONFIG_RAMKERNEL
  226. . = __l2_lma + __l2_len;
  227. #else
  228. . = __init_data_end;
  229. #endif
  230. . = ALIGN(PAGE_SIZE);
  231. ___init_end = .;
  232. __end =.;
  233. STABS_DEBUG
  234. DWARF_DEBUG
  235. DISCARDS
  236. }