vmlinux.lds.S 3.8 KB

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