vmlinux.lds.S 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 <asm-generic/vmlinux.lds.h>
  11. #include <asm/page.h>
  12. #ifdef CONFIG_ETRAX_VMEM_SIZE
  13. #define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
  14. #else
  15. #define __CONFIG_ETRAX_VMEM_SIZE 0
  16. #endif
  17. jiffies = jiffies_64;
  18. SECTIONS
  19. {
  20. . = DRAM_VIRTUAL_BASE;
  21. dram_start = .;
  22. #ifdef CONFIG_ETRAX_ARCH_V10
  23. ibr_start = .;
  24. #else
  25. ebp_start = .;
  26. /* The boot section is only necessary until the VCS top */
  27. /* level testbench includes both flash and DRAM. */
  28. .boot : { *(.boot) }
  29. #endif
  30. /* see head.S and pages reserved at the start */
  31. . = DRAM_VIRTUAL_BASE + 0x4000;
  32. _text = .; /* Text and read-only data. */
  33. text_start = .; /* Lots of aliases. */
  34. _stext = .;
  35. __stext = .;
  36. .text : {
  37. TEXT_TEXT
  38. SCHED_TEXT
  39. LOCK_TEXT
  40. *(.fixup)
  41. *(.text.__*)
  42. }
  43. _etext = . ; /* End of text section. */
  44. __etext = .;
  45. EXCEPTION_TABLE(4)
  46. RODATA
  47. . = ALIGN (4);
  48. ___data_start = . ;
  49. __Sdata = . ;
  50. .data : { /* Data */
  51. CACHELINE_ALIGNED_DATA(32)
  52. READ_MOSTLY_DATA(32)
  53. DATA_DATA
  54. }
  55. __edata = . ; /* End of data section. */
  56. _edata = . ;
  57. INIT_TASK_DATA_SECTION(PAGE_SIZE)
  58. . = ALIGN(PAGE_SIZE); /* Init code and data. */
  59. __init_begin = .;
  60. INIT_TEXT_SECTION(PAGE_SIZE)
  61. .init.data : { INIT_DATA }
  62. .init.setup : { INIT_SETUP(16) }
  63. #ifdef CONFIG_ETRAX_ARCH_V32
  64. __start___param = .;
  65. __param : { *(__param) }
  66. __stop___param = .;
  67. #endif
  68. .initcall.init : {
  69. INIT_CALLS
  70. }
  71. .con_initcall.init : {
  72. CON_INITCALL
  73. }
  74. SECURITY_INIT
  75. /* .exit.text is discarded at runtime, not link time,
  76. * to deal with references from __bug_table
  77. */
  78. .exit.text : {
  79. EXIT_TEXT
  80. }
  81. .exit.data : {
  82. EXIT_DATA
  83. }
  84. #ifdef CONFIG_ETRAX_ARCH_V10
  85. #ifdef CONFIG_BLK_DEV_INITRD
  86. .init.ramfs : {
  87. __initramfs_start = .;
  88. *(.init.ramfs)
  89. __initramfs_end = .;
  90. }
  91. #endif
  92. #endif
  93. __vmlinux_end = .; /* Last address of the physical file. */
  94. #ifdef CONFIG_ETRAX_ARCH_V32
  95. PERCPU(PAGE_SIZE)
  96. .init.ramfs : {
  97. INIT_RAM_FS
  98. }
  99. #endif
  100. /*
  101. * We fill to the next page, so we can discard all init
  102. * pages without needing to consider what payload might be
  103. * appended to the kernel image.
  104. */
  105. . = ALIGN(PAGE_SIZE);
  106. __init_end = .;
  107. __data_end = . ; /* Move to _edata ? */
  108. BSS_SECTION(1, 1, 1)
  109. . = ALIGN (0x20);
  110. _end = .;
  111. __end = .;
  112. dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
  113. DISCARDS
  114. }