vmlinux.lds.S 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. HEAD_TEXT
  30. TEXT_TEXT
  31. SCHED_TEXT
  32. LOCK_TEXT
  33. KPROBES_TEXT
  34. *(.fixup)
  35. *(.gnu.warning)
  36. } = 0xcb
  37. _etext = .; /* End of text section */
  38. . = ALIGN(16); /* Exception table */
  39. __start___ex_table = .;
  40. __ex_table : { *(__ex_table) }
  41. __stop___ex_table = .;
  42. BUG_TABLE
  43. RODATA
  44. /* writeable */
  45. .data : { /* Data */
  46. DATA_DATA
  47. CONSTRUCTORS
  48. }
  49. . = ALIGN(PAGE_SIZE);
  50. __nosave_begin = .;
  51. .data_nosave : { *(.data.nosave) }
  52. . = ALIGN(PAGE_SIZE);
  53. __nosave_end = .;
  54. . = ALIGN(PAGE_SIZE);
  55. .data.page_aligned : { *(.data.idt) }
  56. . = ALIGN(32);
  57. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  58. /* rarely changed data like cpu maps */
  59. . = ALIGN(32);
  60. .data.read_mostly : AT(ADDR(.data.read_mostly)) {
  61. *(.data.read_mostly)
  62. _edata = .; /* End of data section */
  63. }
  64. . = ALIGN(THREAD_SIZE); /* init_task */
  65. .data.init_task : { *(.data.init_task) }
  66. /* might get freed after init */
  67. . = ALIGN(PAGE_SIZE);
  68. .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
  69. __smp_locks = .;
  70. *(.smp_locks)
  71. __smp_locks_end = .;
  72. }
  73. /* will be freed after init */
  74. . = ALIGN(PAGE_SIZE); /* Init code and data */
  75. __init_begin = .;
  76. .init.text : {
  77. _sinittext = .;
  78. *(.init.text)
  79. _einittext = .;
  80. }
  81. .init.data : { *(.init.data) }
  82. . = ALIGN(16);
  83. __setup_start = .;
  84. .setup.init : { KEEP(*(.init.setup)) }
  85. __setup_end = .;
  86. __initcall_start = .;
  87. .initcall.init : {
  88. INITCALLS
  89. }
  90. __initcall_end = .;
  91. __con_initcall_start = .;
  92. .con_initcall.init : { *(.con_initcall.init) }
  93. __con_initcall_end = .;
  94. SECURITY_INIT
  95. . = ALIGN(4);
  96. __alt_instructions = .;
  97. .altinstructions : { *(.altinstructions) }
  98. __alt_instructions_end = .;
  99. .altinstr_replacement : { *(.altinstr_replacement) }
  100. /* .exit.text is discard at runtime, not link time, to deal with references
  101. from .altinstructions and .eh_frame */
  102. .exit.text : { *(.exit.text) }
  103. .exit.data : { *(.exit.data) }
  104. #ifdef CONFIG_BLK_DEV_INITRD
  105. . = ALIGN(PAGE_SIZE);
  106. __initramfs_start = .;
  107. .init.ramfs : { *(.init.ramfs) }
  108. __initramfs_end = .;
  109. #endif
  110. PERCPU(32)
  111. . = ALIGN(PAGE_SIZE);
  112. __init_end = .;
  113. /* freed after init ends here */
  114. __bss_start = .; /* BSS */
  115. .bss : {
  116. *(.bss.page_aligned)
  117. *(.bss)
  118. }
  119. . = ALIGN(4);
  120. __bss_stop = .;
  121. _end = . ;
  122. /* This is where the kernel creates the early boot page tables */
  123. . = ALIGN(PAGE_SIZE);
  124. pg0 = .;
  125. /* Sections to be discarded */
  126. /DISCARD/ : {
  127. *(.exitcall.exit)
  128. }
  129. STABS_DEBUG
  130. DWARF_DEBUG
  131. }