Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* $Id: vmlinux.lds.S,v 1.8 2003/05/16 17:18:14 lethal Exp $ |
| 2 | * ld script to make SuperH Linux kernel |
| 3 | * Written by Niibe Yutaka |
| 4 | */ |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 5 | #include <asm/thread_info.h> |
Paul Mundt | 87e29ca | 2007-03-01 15:56:31 +0900 | [diff] [blame] | 6 | #include <asm/cache.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include <asm-generic/vmlinux.lds.h> |
| 8 | |
| 9 | #ifdef CONFIG_CPU_LITTLE_ENDIAN |
| 10 | OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") |
| 11 | #else |
| 12 | OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") |
| 13 | #endif |
| 14 | OUTPUT_ARCH(sh) |
| 15 | ENTRY(_start) |
| 16 | SECTIONS |
| 17 | { |
Paul Mundt | e7f93a3 | 2006-09-27 17:19:13 +0900 | [diff] [blame] | 18 | . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | _text = .; /* Text and read-only data */ |
| 20 | text = .; /* Text and read-only data */ |
| 21 | .empty_zero_page : { |
| 22 | *(.empty_zero_page) |
| 23 | } = 0 |
| 24 | .text : { |
| 25 | *(.text) |
| 26 | SCHED_TEXT |
| 27 | LOCK_TEXT |
| 28 | *(.fixup) |
| 29 | *(.gnu.warning) |
| 30 | } = 0x0009 |
| 31 | |
| 32 | . = ALIGN(16); /* Exception table */ |
| 33 | __start___ex_table = .; |
| 34 | __ex_table : { *(__ex_table) } |
| 35 | __stop___ex_table = .; |
| 36 | |
| 37 | RODATA |
| 38 | |
| 39 | _etext = .; /* End of text section */ |
| 40 | |
| 41 | .data : { /* Data */ |
| 42 | *(.data) |
| 43 | |
| 44 | /* Align the initial ramdisk image (INITRD) on page boundaries. */ |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 45 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | __rd_start = .; |
| 47 | *(.initrd) |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 48 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | __rd_end = .; |
| 50 | |
| 51 | CONSTRUCTORS |
| 52 | } |
| 53 | |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 54 | . = ALIGN(PAGE_SIZE); |
Paul Mundt | f668f55 | 2006-12-12 08:50:36 +0900 | [diff] [blame] | 55 | .data.page_aligned : { *(.data.page_aligned) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Jeremy Fitzhardinge | b6e3590 | 2007-05-02 19:27:12 +0200 | [diff] [blame^] | 57 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | __per_cpu_start = .; |
| 59 | .data.percpu : { *(.data.percpu) } |
| 60 | __per_cpu_end = .; |
| 61 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } |
| 62 | |
| 63 | _edata = .; /* End of data section */ |
| 64 | |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 65 | . = ALIGN(THREAD_SIZE); /* init_task */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | .data.init_task : { *(.data.init_task) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 68 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | __init_begin = .; |
| 70 | _sinittext = .; |
| 71 | .init.text : { *(.init.text) } |
| 72 | _einittext = .; |
| 73 | .init.data : { *(.init.data) } |
| 74 | . = ALIGN(16); |
| 75 | __setup_start = .; |
| 76 | .init.setup : { *(.init.setup) } |
| 77 | __setup_end = .; |
| 78 | __initcall_start = .; |
| 79 | .initcall.init : { |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 80 | INITCALLS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | } |
| 82 | __initcall_end = .; |
| 83 | __con_initcall_start = .; |
| 84 | .con_initcall.init : { *(.con_initcall.init) } |
| 85 | __con_initcall_end = .; |
| 86 | SECURITY_INIT |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 87 | |
| 88 | #ifdef CONFIG_BLK_DEV_INITRD |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | __initramfs_start = .; |
| 90 | .init.ramfs : { *(.init.ramfs) } |
| 91 | __initramfs_end = .; |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 92 | #endif |
| 93 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | __machvec_start = .; |
| 95 | .init.machvec : { *(.init.machvec) } |
| 96 | __machvec_end = .; |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 97 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | __init_end = .; |
| 99 | |
| 100 | . = ALIGN(4); |
| 101 | __bss_start = .; /* BSS */ |
| 102 | .bss : { *(.bss) } |
| 103 | |
| 104 | . = ALIGN(4); |
| 105 | _end = . ; |
| 106 | |
| 107 | /* When something in the kernel is NOT compiled as a module, the |
| 108 | * module cleanup code and data are put into these segments. Both |
| 109 | * can then be thrown away, as cleanup code is never called unless |
| 110 | * it's a module. |
| 111 | */ |
| 112 | /DISCARD/ : { |
| 113 | *(.exit.text) |
| 114 | *(.exit.data) |
| 115 | *(.exitcall.exit) |
| 116 | } |
| 117 | |
| 118 | /* Stabs debugging sections. */ |
| 119 | .stab 0 : { *(.stab) } |
| 120 | .stabstr 0 : { *(.stabstr) } |
| 121 | .stab.excl 0 : { *(.stab.excl) } |
| 122 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 123 | .stab.index 0 : { *(.stab.index) } |
| 124 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 125 | .comment 0 : { *(.comment) } |
| 126 | /* DWARF debug sections. |
| 127 | Symbols in the DWARF debugging section are relative to the beginning |
| 128 | of the section so we begin .debug at 0. */ |
| 129 | /* DWARF 1 */ |
| 130 | .debug 0 : { *(.debug) } |
| 131 | .line 0 : { *(.line) } |
| 132 | /* GNU DWARF 1 extensions */ |
| 133 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 134 | .debug_sfnames 0 : { *(.debug_sfnames) } |
| 135 | /* DWARF 1.1 and DWARF 2 */ |
| 136 | .debug_aranges 0 : { *(.debug_aranges) } |
| 137 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 138 | /* DWARF 2 */ |
| 139 | .debug_info 0 : { *(.debug_info) } |
| 140 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 141 | .debug_line 0 : { *(.debug_line) } |
| 142 | .debug_frame 0 : { *(.debug_frame) } |
| 143 | .debug_str 0 : { *(.debug_str) } |
| 144 | .debug_loc 0 : { *(.debug_loc) } |
| 145 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 146 | /* SGI/MIPS DWARF 2 extensions */ |
| 147 | .debug_weaknames 0 : { *(.debug_weaknames) } |
| 148 | .debug_funcnames 0 : { *(.debug_funcnames) } |
| 149 | .debug_typenames 0 : { *(.debug_typenames) } |
| 150 | .debug_varnames 0 : { *(.debug_varnames) } |
| 151 | /* These must appear regardless of . */ |
| 152 | } |