vmlinux.lds.S 4.5 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. SCHED_TEXT
  50. LOCK_TEXT
  51. KPROBES_TEXT
  52. *(.text.*)
  53. *(.fixup)
  54. . = ALIGN(16);
  55. ___start___ex_table = .;
  56. *(__ex_table)
  57. ___stop___ex_table = .;
  58. __etext = .;
  59. }
  60. /* Just in case the first read only is a 32-bit access */
  61. RO_DATA(4)
  62. .bss :
  63. {
  64. . = ALIGN(4);
  65. ___bss_start = .;
  66. *(.bss .bss.*)
  67. *(COMMON)
  68. ___bss_stop = .;
  69. }
  70. .data :
  71. {
  72. __sdata = .;
  73. /* This gets done first, so the glob doesn't suck it in */
  74. . = ALIGN(32);
  75. *(.data.cacheline_aligned)
  76. #if !L1_DATA_A_LENGTH
  77. . = ALIGN(32);
  78. *(.data_l1.cacheline_aligned)
  79. #endif
  80. DATA_DATA
  81. *(.data.*)
  82. CONSTRUCTORS
  83. /* make sure the init_task is aligned to the
  84. * kernel thread size so we can locate the kernel
  85. * stack properly and quickly.
  86. */
  87. . = ALIGN(THREAD_SIZE);
  88. *(.init_task.data)
  89. __edata = .;
  90. }
  91. /* The init section should be last, so when we free it, it goes into
  92. * the general memory pool, and (hopefully) will decrease fragmentation
  93. * a tiny bit. The init section has a _requirement_ that it be
  94. * PAGE_SIZE aligned
  95. */
  96. . = ALIGN(PAGE_SIZE);
  97. ___init_begin = .;
  98. .init.text :
  99. {
  100. . = ALIGN(PAGE_SIZE);
  101. __sinittext = .;
  102. INIT_TEXT
  103. __einittext = .;
  104. }
  105. .init.data :
  106. {
  107. . = ALIGN(16);
  108. INIT_DATA
  109. }
  110. .init.setup :
  111. {
  112. . = ALIGN(16);
  113. ___setup_start = .;
  114. *(.init.setup)
  115. ___setup_end = .;
  116. }
  117. .initcall.init :
  118. {
  119. ___initcall_start = .;
  120. INITCALLS
  121. ___initcall_end = .;
  122. }
  123. .con_initcall.init :
  124. {
  125. ___con_initcall_start = .;
  126. *(.con_initcall.init)
  127. ___con_initcall_end = .;
  128. }
  129. SECURITY_INIT
  130. .init.ramfs :
  131. {
  132. . = ALIGN(4);
  133. ___initramfs_start = .;
  134. *(.init.ramfs)
  135. ___initramfs_end = .;
  136. }
  137. __l1_lma_start = .;
  138. #if L1_CODE_LENGTH
  139. # define LDS_L1_CODE *(.l1.text)
  140. #else
  141. # define LDS_L1_CODE
  142. #endif
  143. .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
  144. {
  145. . = ALIGN(4);
  146. __stext_l1 = .;
  147. LDS_L1_CODE
  148. . = ALIGN(4);
  149. __etext_l1 = .;
  150. }
  151. #if L1_DATA_A_LENGTH
  152. # define LDS_L1_A_DATA *(.l1.data)
  153. # define LDS_L1_A_BSS *(.l1.bss)
  154. # define LDS_L1_A_CACHE *(.data_l1.cacheline_aligned)
  155. #else
  156. # define LDS_L1_A_DATA
  157. # define LDS_L1_A_BSS
  158. # define LDS_L1_A_CACHE
  159. #endif
  160. .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
  161. {
  162. . = ALIGN(4);
  163. __sdata_l1 = .;
  164. LDS_L1_A_DATA
  165. __edata_l1 = .;
  166. . = ALIGN(4);
  167. __sbss_l1 = .;
  168. LDS_L1_A_BSS
  169. . = ALIGN(32);
  170. LDS_L1_A_CACHE
  171. . = ALIGN(4);
  172. __ebss_l1 = .;
  173. }
  174. #if L1_DATA_B_LENGTH
  175. # define LDS_L1_B_DATA *(.l1.data.B)
  176. # define LDS_L1_B_BSS *(.l1.bss.B)
  177. #else
  178. # define LDS_L1_B_DATA
  179. # define LDS_L1_B_BSS
  180. #endif
  181. .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
  182. {
  183. . = ALIGN(4);
  184. __sdata_b_l1 = .;
  185. LDS_L1_B_DATA
  186. __edata_b_l1 = .;
  187. . = ALIGN(4);
  188. __sbss_b_l1 = .;
  189. LDS_L1_B_BSS
  190. . = ALIGN(4);
  191. __ebss_b_l1 = .;
  192. }
  193. /* Force trailing alignment of our init section so that when we
  194. * free our init memory, we don't leave behind a partial page.
  195. */
  196. . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
  197. . = ALIGN(PAGE_SIZE);
  198. ___init_end = .;
  199. __end =.;
  200. STABS_DEBUG
  201. DWARF_DEBUG
  202. /DISCARD/ :
  203. {
  204. EXIT_TEXT
  205. EXIT_DATA
  206. *(.exitcall.exit)
  207. }
  208. }