vmlinux.lds.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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. __l1_lma_start = .;
  108. .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
  109. {
  110. . = ALIGN(4);
  111. __stext_l1 = .;
  112. *(.l1.text)
  113. #ifdef CONFIG_SCHEDULE_L1
  114. SCHED_TEXT
  115. #endif
  116. . = ALIGN(4);
  117. __etext_l1 = .;
  118. }
  119. ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
  120. .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
  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. ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
  135. .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
  136. {
  137. . = ALIGN(4);
  138. __sdata_b_l1 = .;
  139. *(.l1.data.B)
  140. __edata_b_l1 = .;
  141. . = ALIGN(4);
  142. __sbss_b_l1 = .;
  143. *(.l1.bss.B)
  144. . = ALIGN(4);
  145. __ebss_b_l1 = .;
  146. }
  147. ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
  148. __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
  149. .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
  150. {
  151. . = ALIGN(4);
  152. __stext_l2 = .;
  153. *(.l2.text)
  154. . = ALIGN(4);
  155. __etext_l2 = .;
  156. . = ALIGN(4);
  157. __sdata_l2 = .;
  158. *(.l2.data)
  159. __edata_l2 = .;
  160. . = ALIGN(32);
  161. *(.data_l2.cacheline_aligned)
  162. . = ALIGN(4);
  163. __sbss_l2 = .;
  164. *(.l2.bss)
  165. . = ALIGN(4);
  166. __ebss_l2 = .;
  167. }
  168. ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!")
  169. /* Force trailing alignment of our init section so that when we
  170. * free our init memory, we don't leave behind a partial page.
  171. */
  172. . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
  173. . = ALIGN(PAGE_SIZE);
  174. ___init_end = .;
  175. __end =.;
  176. STABS_DEBUG
  177. DWARF_DEBUG
  178. DISCARDS
  179. }