vmlinux.lds.S 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /* MN10300 Main kernel linker script
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #define __VMLINUX_LDS__
  12. #include <asm-generic/vmlinux.lds.h>
  13. #include <asm/thread_info.h>
  14. #include <asm/page.h>
  15. OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin")
  16. OUTPUT_ARCH(mn10300)
  17. ENTRY(_start)
  18. jiffies = jiffies_64;
  19. #ifndef CONFIG_MN10300_CURRENT_IN_E2
  20. current = __current;
  21. #endif
  22. SECTIONS
  23. {
  24. . = CONFIG_KERNEL_TEXT_ADDRESS;
  25. /* read-only */
  26. _stext = .;
  27. _text = .; /* Text and read-only data */
  28. .text : {
  29. *(
  30. .text.head
  31. .text
  32. )
  33. TEXT_TEXT
  34. SCHED_TEXT
  35. LOCK_TEXT
  36. KPROBES_TEXT
  37. *(.fixup)
  38. *(.gnu.warning)
  39. } = 0xcb
  40. _etext = .; /* End of text section */
  41. . = ALIGN(16); /* Exception table */
  42. __start___ex_table = .;
  43. __ex_table : { *(__ex_table) }
  44. __stop___ex_table = .;
  45. BUG_TABLE
  46. RODATA
  47. /* writeable */
  48. .data : { /* Data */
  49. DATA_DATA
  50. CONSTRUCTORS
  51. }
  52. . = ALIGN(PAGE_SIZE);
  53. __nosave_begin = .;
  54. .data_nosave : { *(.data.nosave) }
  55. . = ALIGN(PAGE_SIZE);
  56. __nosave_end = .;
  57. . = ALIGN(PAGE_SIZE);
  58. .data.page_aligned : { *(.data.idt) }
  59. . = ALIGN(32);
  60. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  61. /* rarely changed data like cpu maps */
  62. . = ALIGN(32);
  63. .data.read_mostly : AT(ADDR(.data.read_mostly)) {
  64. *(.data.read_mostly)
  65. _edata = .; /* End of data section */
  66. }
  67. . = ALIGN(THREAD_SIZE); /* init_task */
  68. .data.init_task : { *(.data.init_task) }
  69. /* might get freed after init */
  70. . = ALIGN(PAGE_SIZE);
  71. .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
  72. __smp_locks = .;
  73. *(.smp_locks)
  74. __smp_locks_end = .;
  75. }
  76. /* will be freed after init */
  77. . = ALIGN(PAGE_SIZE); /* Init code and data */
  78. __init_begin = .;
  79. .init.text : {
  80. _sinittext = .;
  81. *(.init.text)
  82. _einittext = .;
  83. }
  84. .init.data : { *(.init.data) }
  85. . = ALIGN(16);
  86. __setup_start = .;
  87. .setup.init : { KEEP(*(.init.setup)) }
  88. __setup_end = .;
  89. __initcall_start = .;
  90. .initcall.init : {
  91. INITCALLS
  92. }
  93. __initcall_end = .;
  94. __con_initcall_start = .;
  95. .con_initcall.init : { *(.con_initcall.init) }
  96. __con_initcall_end = .;
  97. SECURITY_INIT
  98. . = ALIGN(4);
  99. __alt_instructions = .;
  100. .altinstructions : { *(.altinstructions) }
  101. __alt_instructions_end = .;
  102. .altinstr_replacement : { *(.altinstr_replacement) }
  103. /* .exit.text is discard at runtime, not link time, to deal with references
  104. from .altinstructions and .eh_frame */
  105. .exit.text : { *(.exit.text) }
  106. .exit.data : { *(.exit.data) }
  107. #ifdef CONFIG_BLK_DEV_INITRD
  108. . = ALIGN(PAGE_SIZE);
  109. __initramfs_start = .;
  110. .init.ramfs : { *(.init.ramfs) }
  111. __initramfs_end = .;
  112. #endif
  113. PERCPU(32)
  114. . = ALIGN(PAGE_SIZE);
  115. __init_end = .;
  116. /* freed after init ends here */
  117. __bss_start = .; /* BSS */
  118. .bss : {
  119. *(.bss.page_aligned)
  120. *(.bss)
  121. }
  122. . = ALIGN(4);
  123. __bss_stop = .;
  124. _end = . ;
  125. /* This is where the kernel creates the early boot page tables */
  126. . = ALIGN(PAGE_SIZE);
  127. pg0 = .;
  128. /* Sections to be discarded */
  129. /DISCARD/ : {
  130. *(.exitcall.exit)
  131. }
  132. STABS_DEBUG
  133. DWARF_DEBUG
  134. }