vmlinux.lds.S 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
  3. * Copyright (C) 2008-2009 PetaLogix
  4. * Copyright (C) 2006 Atmark Techno, Inc.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze")
  11. OUTPUT_ARCH(microblaze)
  12. ENTRY(_start)
  13. #include <asm-generic/vmlinux.lds.h>
  14. #include <asm/page.h>
  15. #include <asm/thread_info.h>
  16. jiffies = jiffies_64 + 4;
  17. SECTIONS {
  18. . = CONFIG_KERNEL_START;
  19. .text : {
  20. _text = . ;
  21. _stext = . ;
  22. *(.text .text.*)
  23. *(.fixup)
  24. EXIT_TEXT
  25. EXIT_CALL
  26. SCHED_TEXT
  27. LOCK_TEXT
  28. KPROBES_TEXT
  29. . = ALIGN (4) ;
  30. _etext = . ;
  31. }
  32. . = ALIGN (4) ;
  33. _fdt_start = . ; /* place for fdt blob */
  34. . = . + 0x4000;
  35. _fdt_end = . ;
  36. . = ALIGN(16);
  37. RODATA
  38. EXCEPTION_TABLE(16)
  39. /*
  40. * sdata2 section can go anywhere, but must be word aligned
  41. * and SDA2_BASE must point to the middle of it
  42. */
  43. .sdata2 : {
  44. _ssrw = .;
  45. . = ALIGN(4096); /* page aligned when MMU used - origin 0x8 */
  46. *(.sdata2)
  47. . = ALIGN(8);
  48. _essrw = .;
  49. _ssrw_size = _essrw - _ssrw;
  50. _KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
  51. }
  52. _sdata = . ;
  53. RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
  54. _edata = . ;
  55. /* Reserve some low RAM for r0 based memory references */
  56. . = ALIGN(0x4) ;
  57. r0_ram = . ;
  58. . = . + 4096; /* a page should be enough */
  59. /* Under the microblaze ABI, .sdata and .sbss must be contiguous */
  60. . = ALIGN(8);
  61. .sdata : {
  62. _ssro = .;
  63. *(.sdata)
  64. }
  65. .sbss : {
  66. _ssbss = .;
  67. *(.sbss)
  68. _esbss = .;
  69. _essro = .;
  70. _ssro_size = _essro - _ssro ;
  71. _KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
  72. }
  73. __init_begin = .;
  74. INIT_TEXT_SECTION(PAGE_SIZE)
  75. .init.data : {
  76. INIT_DATA
  77. }
  78. . = ALIGN(4);
  79. .init.ivt : {
  80. __ivt_start = .;
  81. *(.init.ivt)
  82. __ivt_end = .;
  83. }
  84. .init.setup : {
  85. INIT_SETUP(0)
  86. }
  87. .initcall.init : {
  88. INIT_CALLS
  89. }
  90. .con_initcall.init : {
  91. CON_INITCALL
  92. }
  93. SECURITY_INIT
  94. __init_end_before_initramfs = .;
  95. .init.ramfs ALIGN(4096) : {
  96. __initramfs_start = .;
  97. *(.init.ramfs)
  98. __initramfs_end = .;
  99. . = ALIGN(4);
  100. LONG(0);
  101. /*
  102. * FIXME this can break initramfs for MMU.
  103. * Pad init.ramfs up to page boundary,
  104. * so that __init_end == __bss_start. This will make image.elf
  105. * consistent with the image.bin
  106. */
  107. /* . = ALIGN(4096); */
  108. }
  109. __init_end = .;
  110. .bss ALIGN (4096) : { /* page aligned when MMU used */
  111. __bss_start = . ;
  112. *(.bss*)
  113. *(COMMON)
  114. . = ALIGN (4) ;
  115. __bss_stop = . ;
  116. _ebss = . ;
  117. }
  118. . = ALIGN(4096);
  119. _end = .;
  120. DISCARDS
  121. }