vmlinux.lds.S 3.8 KB

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