vmlinux.lds.S 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. /* We have to discard exit text and such at runtime, not link time, to
  92. * handle embedded cross-section references (alt instructions, bug
  93. * table, eh_frame, etc...). We need all of our .text up front and
  94. * .data after it for PCREL call issues.
  95. */
  96. .exit.text :
  97. {
  98. EXIT_TEXT
  99. }
  100. . = ALIGN(16);
  101. INIT_DATA_SECTION(16)
  102. PERCPU(4)
  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. }