vmlinux.lds.S 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <asm/vmlinux.lds.h>
  3. #include <asm/page.h>
  4. #include <asm/memory.h>
  5. OUTPUT_ARCH(csky)
  6. ENTRY(_start)
  7. #ifndef __cskyBE__
  8. jiffies = jiffies_64;
  9. #else
  10. jiffies = jiffies_64 + 4;
  11. #endif
  12. #define VBR_BASE \
  13. . = ALIGN(1024); \
  14. vec_base = .; \
  15. . += 512;
  16. SECTIONS
  17. {
  18. . = PAGE_OFFSET + PHYS_OFFSET_OFFSET;
  19. _start = .;
  20. HEAD_TEXT_SECTION
  21. . = ALIGN(PAGE_SIZE);
  22. .text : AT(ADDR(.text) - LOAD_OFFSET) {
  23. _text = .;
  24. _stext = .;
  25. VBR_BASE
  26. IRQENTRY_TEXT
  27. SOFTIRQENTRY_TEXT
  28. TEXT_TEXT
  29. SCHED_TEXT
  30. LOCK_TEXT
  31. KPROBES_TEXT
  32. *(.fixup)
  33. *(.gnu.warning)
  34. } = 0
  35. _etext = .;
  36. /* __init_begin __init_end must be page aligned for free_initmem */
  37. . = ALIGN(PAGE_SIZE);
  38. __init_begin = .;
  39. INIT_TEXT_SECTION(PAGE_SIZE)
  40. INIT_DATA_SECTION(PAGE_SIZE)
  41. PERCPU_SECTION(L1_CACHE_BYTES)
  42. . = ALIGN(PAGE_SIZE);
  43. __init_end = .;
  44. _sdata = .;
  45. RO_DATA(PAGE_SIZE)
  46. RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
  47. _edata = .;
  48. #ifdef CONFIG_HAVE_TCM
  49. .tcm_start : {
  50. . = ALIGN(PAGE_SIZE);
  51. __tcm_start = .;
  52. }
  53. .text_data_tcm FIXADDR_TCM : AT(__tcm_start)
  54. {
  55. . = ALIGN(4);
  56. __stcm_text_data = .;
  57. *(.tcm.text)
  58. *(.tcm.rodata)
  59. #ifndef CONFIG_HAVE_DTCM
  60. *(.tcm.data)
  61. #endif
  62. . = ALIGN(4);
  63. __etcm_text_data = .;
  64. }
  65. . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_data_tcm);
  66. #ifdef CONFIG_HAVE_DTCM
  67. #define ITCM_SIZE CONFIG_ITCM_NR_PAGES * PAGE_SIZE
  68. .dtcm_start : {
  69. __dtcm_start = .;
  70. }
  71. .data_tcm FIXADDR_TCM + ITCM_SIZE : AT(__dtcm_start)
  72. {
  73. . = ALIGN(4);
  74. __stcm_data = .;
  75. *(.tcm.data)
  76. . = ALIGN(4);
  77. __etcm_data = .;
  78. }
  79. . = ADDR(.dtcm_start) + SIZEOF(.data_tcm);
  80. .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_tcm)) {
  81. #else
  82. .tcm_end : AT(ADDR(.tcm_start) + SIZEOF(.text_data_tcm)) {
  83. #endif
  84. . = ALIGN(PAGE_SIZE);
  85. __tcm_end = .;
  86. }
  87. #endif
  88. EXCEPTION_TABLE(L1_CACHE_BYTES)
  89. BSS_SECTION(L1_CACHE_BYTES, PAGE_SIZE, L1_CACHE_BYTES)
  90. _end = . ;
  91. STABS_DEBUG
  92. DWARF_DEBUG
  93. ELF_DETAILS
  94. DISCARDS
  95. }