vmlinux.lds.S 3.1 KB

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