PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/arch/x86_64/kernel/vmlinux.lds.S

https://bitbucket.org/evzijst/gittest
Assembly | 164 lines | 144 code | 20 blank | 0 comment | 0 complexity | 66d6cae739faa5c934ef5c9ad1ec6640 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, GPL-2.0, LGPL-2.0
  1. /* ld script to make x86-64 Linux kernel
  2. * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
  3. */
  4. #include <asm-generic/vmlinux.lds.h>
  5. #include <linux/config.h>
  6. OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
  7. OUTPUT_ARCH(i386:x86-64)
  8. ENTRY(phys_startup_64)
  9. jiffies_64 = jiffies;
  10. SECTIONS
  11. {
  12. . = 0xffffffff80100000;
  13. phys_startup_64 = startup_64 - LOAD_OFFSET;
  14. _text = .; /* Text and read-only data */
  15. .text : {
  16. *(.text)
  17. SCHED_TEXT
  18. LOCK_TEXT
  19. *(.fixup)
  20. *(.gnu.warning)
  21. } = 0x9090
  22. .text.lock : { *(.text.lock) } /* out-of-line lock text */
  23. _etext = .; /* End of text section */
  24. . = ALIGN(16); /* Exception table */
  25. __start___ex_table = .;
  26. __ex_table : { *(__ex_table) }
  27. __stop___ex_table = .;
  28. RODATA
  29. .data : { /* Data */
  30. *(.data)
  31. CONSTRUCTORS
  32. }
  33. _edata = .; /* End of data section */
  34. __bss_start = .; /* BSS */
  35. .bss : {
  36. *(.bss.page_aligned)
  37. *(.bss)
  38. }
  39. __bss_end = .;
  40. . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
  41. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  42. #define AFTER(x) BINALIGN(LOADADDR(x) + SIZEOF(x), 16)
  43. #define BINALIGN(x,y) (((x) + (y) - 1) & ~((y) - 1))
  44. #define CACHE_ALIGN(x) BINALIGN(x, CONFIG_X86_L1_CACHE_BYTES)
  45. .vsyscall_0 -10*1024*1024: AT ((LOADADDR(.data.cacheline_aligned) + SIZEOF(.data.cacheline_aligned) + 4095) & ~(4095)) { *(.vsyscall_0) }
  46. __vsyscall_0 = LOADADDR(.vsyscall_0);
  47. . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
  48. .xtime_lock : AT CACHE_ALIGN(AFTER(.vsyscall_0)) { *(.xtime_lock) }
  49. xtime_lock = LOADADDR(.xtime_lock);
  50. .vxtime : AT AFTER(.xtime_lock) { *(.vxtime) }
  51. vxtime = LOADADDR(.vxtime);
  52. .wall_jiffies : AT AFTER(.vxtime) { *(.wall_jiffies) }
  53. wall_jiffies = LOADADDR(.wall_jiffies);
  54. .sys_tz : AT AFTER(.wall_jiffies) { *(.sys_tz) }
  55. sys_tz = LOADADDR(.sys_tz);
  56. .sysctl_vsyscall : AT AFTER(.sys_tz) { *(.sysctl_vsyscall) }
  57. sysctl_vsyscall = LOADADDR(.sysctl_vsyscall);
  58. .xtime : AT AFTER(.sysctl_vsyscall) { *(.xtime) }
  59. xtime = LOADADDR(.xtime);
  60. . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
  61. .jiffies : AT CACHE_ALIGN(AFTER(.xtime)) { *(.jiffies) }
  62. jiffies = LOADADDR(.jiffies);
  63. .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) }
  64. . = LOADADDR(.vsyscall_0) + 4096;
  65. . = ALIGN(8192); /* init_task */
  66. .data.init_task : { *(.data.init_task) }
  67. . = ALIGN(4096);
  68. .data.page_aligned : { *(.data.page_aligned) }
  69. . = ALIGN(4096); /* Init code and data */
  70. __init_begin = .;
  71. .init.text : {
  72. _sinittext = .;
  73. *(.init.text)
  74. _einittext = .;
  75. }
  76. __initdata_begin = .;
  77. .init.data : { *(.init.data) }
  78. __initdata_end = .;
  79. . = ALIGN(16);
  80. __setup_start = .;
  81. .init.setup : { *(.init.setup) }
  82. __setup_end = .;
  83. __initcall_start = .;
  84. .initcall.init : {
  85. *(.initcall1.init)
  86. *(.initcall2.init)
  87. *(.initcall3.init)
  88. *(.initcall4.init)
  89. *(.initcall5.init)
  90. *(.initcall6.init)
  91. *(.initcall7.init)
  92. }
  93. __initcall_end = .;
  94. __con_initcall_start = .;
  95. .con_initcall.init : { *(.con_initcall.init) }
  96. __con_initcall_end = .;
  97. SECURITY_INIT
  98. . = ALIGN(8);
  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. . = ALIGN(4096);
  108. __initramfs_start = .;
  109. .init.ramfs : { *(.init.ramfs) }
  110. __initramfs_end = .;
  111. . = ALIGN(32);
  112. __per_cpu_start = .;
  113. .data.percpu : { *(.data.percpu) }
  114. __per_cpu_end = .;
  115. . = ALIGN(4096);
  116. __init_end = .;
  117. . = ALIGN(4096);
  118. __nosave_begin = .;
  119. .data_nosave : { *(.data.nosave) }
  120. . = ALIGN(4096);
  121. __nosave_end = .;
  122. _end = . ;
  123. /* Sections to be discarded */
  124. /DISCARD/ : {
  125. *(.exitcall.exit)
  126. #ifndef CONFIG_DEBUG_INFO
  127. *(.eh_frame)
  128. #endif
  129. }
  130. /* DWARF 2 */
  131. .debug_info 0 : { *(.debug_info) }
  132. .debug_abbrev 0 : { *(.debug_abbrev) }
  133. .debug_line 0 : { *(.debug_line) }
  134. .debug_frame 0 : { *(.debug_frame) }
  135. .debug_str 0 : { *(.debug_str) }
  136. .debug_loc 0 : { *(.debug_loc) }
  137. .debug_macinfo 0 : { *(.debug_macinfo) }
  138. /* SGI/MIPS DWARF 2 extensions */
  139. .debug_weaknames 0 : { *(.debug_weaknames) }
  140. .debug_funcnames 0 : { *(.debug_funcnames) }
  141. .debug_typenames 0 : { *(.debug_typenames) }
  142. .debug_varnames 0 : { *(.debug_varnames) }
  143. .comment 0 : { *(.comment) }
  144. }