vmlinux.lds.S 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <asm-generic/vmlinux.lds.h>
  9. #include <asm/cache.h>
  10. #include <asm/page.h>
  11. #include <asm/thread_info.h>
  12. OUTPUT_ARCH(arc)
  13. ENTRY(res_service)
  14. #ifdef CONFIG_CPU_BIG_ENDIAN
  15. jiffies = jiffies_64 + 4;
  16. #else
  17. jiffies = jiffies_64;
  18. #endif
  19. SECTIONS
  20. {
  21. /*
  22. * ICCM starts at 0x8000_0000. So if kernel is relocated to some other
  23. * address, make sure peripheral at 0x8z doesn't clash with ICCM
  24. * Essentially vector is also in ICCM.
  25. */
  26. . = CONFIG_LINUX_LINK_BASE;
  27. _int_vec_base_lds = .;
  28. .vector : {
  29. *(.vector)
  30. . = ALIGN(PAGE_SIZE);
  31. }
  32. #ifdef CONFIG_ARC_HAS_ICCM
  33. .text.arcfp : {
  34. *(.text.arcfp)
  35. . = ALIGN(CONFIG_ARC_ICCM_SZ * 1024);
  36. }
  37. #endif
  38. /*
  39. * The reason for having a seperate subsection .init.ramfs is to
  40. * prevent objump from including it in kernel dumps
  41. *
  42. * Reason for having .init.ramfs above .init is to make sure that the
  43. * binary blob is tucked away to one side, reducing the displacement
  44. * between .init.text and .text, avoiding any possible relocation
  45. * errors because of calls from .init.text to .text
  46. * Yes such calls do exist. e.g.
  47. * decompress_inflate.c:gunzip( ) -> zlib_inflate_workspace( )
  48. */
  49. __init_begin = .;
  50. .init.ramfs : { INIT_RAM_FS }
  51. . = ALIGN(PAGE_SIZE);
  52. _stext = .;
  53. HEAD_TEXT_SECTION
  54. INIT_TEXT_SECTION(L1_CACHE_BYTES)
  55. /* INIT_DATA_SECTION open-coded: special INIT_RAM_FS handling */
  56. .init.data : {
  57. INIT_DATA
  58. INIT_SETUP(L1_CACHE_BYTES)
  59. INIT_CALLS
  60. CON_INITCALL
  61. SECURITY_INITCALL
  62. }
  63. .init.arch.info : {
  64. __arch_info_begin = .;
  65. *(.arch.info.init)
  66. __arch_info_end = .;
  67. }
  68. PERCPU_SECTION(L1_CACHE_BYTES)
  69. /*
  70. * .exit.text is discard at runtime, not link time, to deal with
  71. * references from .debug_frame
  72. * It will be init freed, being inside [__init_start : __init_end]
  73. */
  74. .exit.text : { EXIT_TEXT }
  75. .exit.data : { EXIT_DATA }
  76. . = ALIGN(PAGE_SIZE);
  77. __init_end = .;
  78. .text : {
  79. _text = .;
  80. TEXT_TEXT
  81. SCHED_TEXT
  82. LOCK_TEXT
  83. KPROBES_TEXT
  84. *(.fixup)
  85. *(.gnu.warning)
  86. }
  87. EXCEPTION_TABLE(L1_CACHE_BYTES)
  88. _etext = .;
  89. _sdata = .;
  90. RO_DATA_SECTION(PAGE_SIZE)
  91. /*
  92. * 1. this is .data essentially
  93. * 2. THREAD_SIZE for init.task, must be kernel-stk sz aligned
  94. */
  95. RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
  96. _edata = .;
  97. BSS_SECTION(4, 4, 4)
  98. #ifdef CONFIG_ARC_DW2_UNWIND
  99. . = ALIGN(PAGE_SIZE);
  100. .debug_frame : {
  101. __start_unwind = .;
  102. *(.debug_frame)
  103. __end_unwind = .;
  104. }
  105. /*
  106. * gcc 4.8 generates this for -fasynchonous-unwind-tables,
  107. * while we still use the .debug_frame based unwinder
  108. */
  109. /DISCARD/ : { *(.eh_frame) }
  110. #else
  111. /DISCARD/ : { *(.debug_frame) }
  112. #endif
  113. NOTES
  114. . = ALIGN(PAGE_SIZE);
  115. _end = . ;
  116. STABS_DEBUG
  117. DISCARDS
  118. .arcextmap 0 : {
  119. *(.gnu.linkonce.arcextmap.*)
  120. *(.arcextmap.*)
  121. }
  122. #ifndef CONFIG_DEBUG_INFO
  123. /* open-coded because we need .debug_frame seperately for unwinding */
  124. /DISCARD/ : { *(.debug_aranges) }
  125. /DISCARD/ : { *(.debug_pubnames) }
  126. /DISCARD/ : { *(.debug_info) }
  127. /DISCARD/ : { *(.debug_abbrev) }
  128. /DISCARD/ : { *(.debug_line) }
  129. /DISCARD/ : { *(.debug_str) }
  130. /DISCARD/ : { *(.debug_loc) }
  131. /DISCARD/ : { *(.debug_macinfo) }
  132. /DISCARD/ : { *(.debug_ranges) }
  133. #endif
  134. #ifdef CONFIG_ARC_HAS_DCCM
  135. . = CONFIG_ARC_DCCM_BASE;
  136. __arc_dccm_base = .;
  137. .data.arcfp : {
  138. *(.data.arcfp)
  139. }
  140. . = ALIGN(CONFIG_ARC_DCCM_SZ * 1024);
  141. #endif
  142. }