vmlinux.lds.S 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* ld script to make the Linux/CRIS kernel
  2. * Authors: Bjorn Wesen (bjornw@axis.com)
  3. *
  4. * It is VERY DANGEROUS to fiddle around with the symbols in this
  5. * script. It is for example quite vital that all generated sections
  6. * that are used are actually named here, otherwise the linker will
  7. * put them at the end, where the init stuff is which is FREED after
  8. * the kernel has booted.
  9. */
  10. #include <linux/autoconf.h>
  11. #include <asm-generic/vmlinux.lds.h>
  12. #include <asm/page.h>
  13. #ifdef CONFIG_ETRAX_VMEM_SIZE
  14. #define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
  15. #else
  16. #define __CONFIG_ETRAX_VMEM_SIZE 0
  17. #endif
  18. jiffies = jiffies_64;
  19. SECTIONS
  20. {
  21. . = DRAM_VIRTUAL_BASE;
  22. dram_start = .;
  23. #ifdef CONFIG_ETRAX_ARCH_V10
  24. ibr_start = .;
  25. #else
  26. ebp_start = .;
  27. /* The boot section is only necessary until the VCS top */
  28. /* level testbench includes both flash and DRAM. */
  29. .boot : { *(.boot) }
  30. #endif
  31. /* see head.S and pages reserved at the start */
  32. . = DRAM_VIRTUAL_BASE + 0x4000;
  33. _text = .; /* Text and read-only data. */
  34. text_start = .; /* Lots of aliases. */
  35. _stext = .;
  36. __stext = .;
  37. .text : {
  38. TEXT_TEXT
  39. SCHED_TEXT
  40. LOCK_TEXT
  41. *(.fixup)
  42. *(.text.__*)
  43. }
  44. _etext = . ; /* End of text section. */
  45. __etext = .;
  46. . = ALIGN(4); /* Exception table. */
  47. __start___ex_table = .;
  48. __ex_table : { *(__ex_table) }
  49. __stop___ex_table = .;
  50. RODATA
  51. . = ALIGN (4);
  52. ___data_start = . ;
  53. __Sdata = . ;
  54. .data : { /* Data */
  55. DATA_DATA
  56. }
  57. __edata = . ; /* End of data section. */
  58. _edata = . ;
  59. . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
  60. .data.init_task : { *(.data.init_task) }
  61. . = ALIGN(PAGE_SIZE); /* Init code and data. */
  62. __init_begin = .;
  63. .init.text : {
  64. _sinittext = .;
  65. INIT_TEXT
  66. _einittext = .;
  67. }
  68. .init.data : { INIT_DATA }
  69. . = ALIGN(16);
  70. __setup_start = .;
  71. .init.setup : { *(.init.setup) }
  72. __setup_end = .;
  73. #ifdef CONFIG_ETRAX_ARCH_V32
  74. __start___param = .;
  75. __param : { *(__param) }
  76. __stop___param = .;
  77. #endif
  78. .initcall.init : {
  79. __initcall_start = .;
  80. INITCALLS
  81. __initcall_end = .;
  82. }
  83. .con_initcall.init : {
  84. __con_initcall_start = .;
  85. *(.con_initcall.init)
  86. __con_initcall_end = .;
  87. }
  88. SECURITY_INIT
  89. #ifdef CONFIG_ETRAX_ARCH_V10
  90. #ifdef CONFIG_BLK_DEV_INITRD
  91. .init.ramfs : {
  92. __initramfs_start = .;
  93. *(.init.ramfs)
  94. __initramfs_end = .;
  95. }
  96. #endif
  97. #endif
  98. __vmlinux_end = .; /* Last address of the physical file. */
  99. #ifdef CONFIG_ETRAX_ARCH_V32
  100. PERCPU(PAGE_SIZE)
  101. .init.ramfs : {
  102. __initramfs_start = .;
  103. *(.init.ramfs)
  104. __initramfs_end = .;
  105. }
  106. #endif
  107. /*
  108. * We fill to the next page, so we can discard all init
  109. * pages without needing to consider what payload might be
  110. * appended to the kernel image.
  111. */
  112. . = ALIGN(PAGE_SIZE);
  113. __init_end = .;
  114. __data_end = . ; /* Move to _edata ? */
  115. __bss_start = .; /* BSS. */
  116. .bss : {
  117. *(COMMON)
  118. *(.bss)
  119. }
  120. . = ALIGN (0x20);
  121. _end = .;
  122. __end = .;
  123. /* Sections to be discarded */
  124. /DISCARD/ : {
  125. EXIT_TEXT
  126. EXIT_DATA
  127. *(.exitcall.exit)
  128. }
  129. dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
  130. }