vmlinux.lds.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. __l1_lma_start = .;
  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. ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
  119. .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
  120. {
  121. . = ALIGN(4);
  122. __sdata_l1 = .;
  123. *(.l1.data)
  124. __edata_l1 = .;
  125. . = ALIGN(32);
  126. *(.data_l1.cacheline_aligned)
  127. . = ALIGN(4);
  128. __sbss_l1 = .;
  129. *(.l1.bss)
  130. . = ALIGN(4);
  131. __ebss_l1 = .;
  132. }
  133. ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
  134. .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
  135. {
  136. . = ALIGN(4);
  137. __sdata_b_l1 = .;
  138. *(.l1.data.B)
  139. __edata_b_l1 = .;
  140. . = ALIGN(4);
  141. __sbss_b_l1 = .;
  142. *(.l1.bss.B)
  143. . = ALIGN(4);
  144. __ebss_b_l1 = .;
  145. }
  146. ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
  147. __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
  148. .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
  149. {
  150. . = ALIGN(4);
  151. __stext_l2 = .;
  152. *(.l2.text)
  153. . = ALIGN(4);
  154. __etext_l2 = .;
  155. . = ALIGN(4);
  156. __sdata_l2 = .;
  157. *(.l2.data)
  158. __edata_l2 = .;
  159. . = ALIGN(32);
  160. *(.data_l2.cacheline_aligned)
  161. . = ALIGN(4);
  162. __sbss_l2 = .;
  163. *(.l2.bss)
  164. . = ALIGN(4);
  165. __ebss_l2 = .;
  166. }
  167. ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!")
  168. /* Force trailing alignment of our init section so that when we
  169. * free our init memory, we don't leave behind a partial page.
  170. */
  171. . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
  172. . = ALIGN(PAGE_SIZE);
  173. ___init_end = .;
  174. __end =.;
  175. STABS_DEBUG
  176. DWARF_DEBUG
  177. DISCARDS
  178. }