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 : { |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 25 | TEXT_TEXT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Paul Mundt | fa69151 | 2007-03-08 19:41:21 +0900 | [diff] [blame] | 37 | _etext = .; /* End of text section */ |
| 38 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | RODATA |
| 40 | |
Paul Mundt | fa69151 | 2007-03-08 19:41:21 +0900 | [diff] [blame] | 41 | BUG_TABLE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | |
| 43 | .data : { /* Data */ |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 44 | DATA_DATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | /* Align the initial ramdisk image (INITRD) on page boundaries. */ |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 47 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | __rd_start = .; |
| 49 | *(.initrd) |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 50 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | __rd_end = .; |
| 52 | |
| 53 | CONSTRUCTORS |
| 54 | } |
| 55 | |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 56 | . = ALIGN(PAGE_SIZE); |
Paul Mundt | f668f55 | 2006-12-12 08:50:36 +0900 | [diff] [blame] | 57 | .data.page_aligned : { *(.data.page_aligned) } |
Paul Mundt | fa69151 | 2007-03-08 19:41:21 +0900 | [diff] [blame] | 58 | __nosave_begin = .; |
| 59 | .data_nosave : { *(.data.nosave) } |
| 60 | . = ALIGN(PAGE_SIZE); |
| 61 | __nosave_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | |
Fenghua Yu | 5fb7dc3 | 2007-07-19 01:48:12 -0700 | [diff] [blame^] | 63 | PERCPU(PAGE_SIZE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } |
| 65 | |
| 66 | _edata = .; /* End of data section */ |
| 67 | |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 68 | . = ALIGN(THREAD_SIZE); /* init_task */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | .data.init_task : { *(.data.init_task) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 71 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | __init_begin = .; |
| 73 | _sinittext = .; |
| 74 | .init.text : { *(.init.text) } |
| 75 | _einittext = .; |
| 76 | .init.data : { *(.init.data) } |
| 77 | . = ALIGN(16); |
| 78 | __setup_start = .; |
| 79 | .init.setup : { *(.init.setup) } |
| 80 | __setup_end = .; |
| 81 | __initcall_start = .; |
| 82 | .initcall.init : { |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 83 | INITCALLS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | } |
| 85 | __initcall_end = .; |
| 86 | __con_initcall_start = .; |
| 87 | .con_initcall.init : { *(.con_initcall.init) } |
| 88 | __con_initcall_end = .; |
| 89 | SECURITY_INIT |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 90 | |
| 91 | #ifdef CONFIG_BLK_DEV_INITRD |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | __initramfs_start = .; |
| 93 | .init.ramfs : { *(.init.ramfs) } |
| 94 | __initramfs_end = .; |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 95 | #endif |
| 96 | |
Takashi YOSHII | 3a3c60f | 2007-05-23 12:34:13 +0900 | [diff] [blame] | 97 | . = ALIGN(4); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | __machvec_start = .; |
Paul Mundt | 9655ad0 | 2007-05-14 15:59:09 +0900 | [diff] [blame] | 99 | .machvec.init : { *(.machvec.init) } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | __machvec_end = .; |
Paul Mundt | 9655ad0 | 2007-05-14 15:59:09 +0900 | [diff] [blame] | 101 | |
Paul Mundt | d153ea8 | 2006-09-27 18:20:16 +0900 | [diff] [blame] | 102 | . = ALIGN(PAGE_SIZE); |
Paul Mundt | e181127 | 2007-07-12 10:40:36 +0900 | [diff] [blame] | 103 | .bss : { |
| 104 | __init_end = .; |
| 105 | __bss_start = .; /* BSS */ |
| 106 | *(.bss.page_aligned) |
| 107 | *(.bss) |
| 108 | . = ALIGN(4); |
| 109 | _end = . ; |
| 110 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | |
| 112 | /* When something in the kernel is NOT compiled as a module, the |
| 113 | * module cleanup code and data are put into these segments. Both |
| 114 | * can then be thrown away, as cleanup code is never called unless |
| 115 | * it's a module. |
| 116 | */ |
| 117 | /DISCARD/ : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | *(.exitcall.exit) |
| 119 | } |
| 120 | |
Paul Mundt | fa69151 | 2007-03-08 19:41:21 +0900 | [diff] [blame] | 121 | STABS_DEBUG |
| 122 | |
| 123 | DWARF_DEBUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | } |