| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* ld script to make s390 Linux kernel |
| 2 | * Written by Martin Schwidefsky (schwidefsky@de.ibm.com) | ||||
| 3 | */ | ||||
| 4 | |||||
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 5 | #include <asm/page.h> |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | #include <asm-generic/vmlinux.lds.h> |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
| Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 8 | #ifndef CONFIG_64BIT |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") |
| 10 | OUTPUT_ARCH(s390) | ||||
| 11 | ENTRY(_start) | ||||
| 12 | jiffies = jiffies_64 + 4; | ||||
| 13 | #else | ||||
| 14 | OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") | ||||
| 15 | OUTPUT_ARCH(s390:64-bit) | ||||
| 16 | ENTRY(_start) | ||||
| 17 | jiffies = jiffies_64; | ||||
| 18 | #endif | ||||
| 19 | |||||
| 20 | SECTIONS | ||||
| 21 | { | ||||
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 22 | . = 0x00000000; |
| 23 | .text : { | ||||
| 24 | _text = .; /* Text and read-only data */ | ||||
| 25 | *(.text.head) | ||||
| Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 26 | TEXT_TEXT |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 27 | SCHED_TEXT |
| 28 | LOCK_TEXT | ||||
| 29 | KPROBES_TEXT | ||||
| 30 | *(.fixup) | ||||
| 31 | *(.gnu.warning) | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | } = 0x0700 |
| 33 | |||||
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 34 | _etext = .; /* End of text section */ |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 36 | RODATA |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
| 38 | #ifdef CONFIG_SHARED_KERNEL | ||||
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 39 | . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */ |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #endif |
| 41 | |||||
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 42 | . = ALIGN(PAGE_SIZE); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 43 | _eshared = .; /* End of shareable data */ |
| Heiko Carstens | 162e006 | 2007-02-05 21:18:41 +0100 | [diff] [blame] | 44 | |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 45 | . = ALIGN(16); /* Exception table */ |
| 46 | __ex_table : { | ||||
| 47 | __start___ex_table = .; | ||||
| 48 | *(__ex_table) | ||||
| 49 | __stop___ex_table = .; | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | } |
| 51 | |||||
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 52 | NOTES |
| 53 | BUG_TABLE | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 55 | .data : { /* Data */ |
| 56 | DATA_DATA | ||||
| 57 | CONSTRUCTORS | ||||
| 58 | } | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 60 | . = ALIGN(PAGE_SIZE); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 61 | .data_nosave : { |
| 62 | __nosave_begin = .; | ||||
| 63 | *(.data.nosave) | ||||
| 64 | } | ||||
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 65 | . = ALIGN(PAGE_SIZE); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 66 | __nosave_end = .; |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 68 | . = ALIGN(PAGE_SIZE); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 69 | .data.page_aligned : { |
| 70 | *(.data.idt) | ||||
| 71 | } | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 73 | . = ALIGN(0x100); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 74 | .data.cacheline_aligned : { |
| 75 | *(.data.cacheline_aligned) | ||||
| 76 | } | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | |
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 78 | . = ALIGN(0x100); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 79 | .data.read_mostly : { |
| 80 | *(.data.read_mostly) | ||||
| 81 | } | ||||
| 82 | _edata = .; /* End of data section */ | ||||
| Heiko Carstens | c0007f1 | 2007-04-27 16:01:42 +0200 | [diff] [blame] | 83 | |
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 84 | . = ALIGN(2 * PAGE_SIZE); /* init_task */ |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 85 | .data.init_task : { |
| 86 | *(.data.init_task) | ||||
| 87 | } | ||||
| 88 | |||||
| 89 | /* will be freed after init */ | ||||
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 90 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 91 | __init_begin = .; |
| 92 | .init.text : { | ||||
| 93 | _sinittext = .; | ||||
| 94 | *(.init.text) | ||||
| 95 | _einittext = .; | ||||
| 96 | } | ||||
| 97 | /* | ||||
| 98 | * .exit.text is discarded at runtime, not link time, | ||||
| 99 | * to deal with references from __bug_table | ||||
| 100 | */ | ||||
| 101 | .exit.text : { | ||||
| 102 | *(.exit.text) | ||||
| 103 | } | ||||
| 104 | |||||
| 105 | .init.data : { | ||||
| 106 | *(.init.data) | ||||
| 107 | } | ||||
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 108 | . = ALIGN(0x100); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 109 | .init.setup : { |
| 110 | __setup_start = .; | ||||
| 111 | *(.init.setup) | ||||
| 112 | __setup_end = .; | ||||
| 113 | } | ||||
| 114 | .initcall.init : { | ||||
| 115 | __initcall_start = .; | ||||
| 116 | INITCALLS | ||||
| 117 | __initcall_end = .; | ||||
| 118 | } | ||||
| 119 | |||||
| 120 | .con_initcall.init : { | ||||
| 121 | __con_initcall_start = .; | ||||
| 122 | *(.con_initcall.init) | ||||
| 123 | __con_initcall_end = .; | ||||
| 124 | } | ||||
| 125 | SECURITY_INIT | ||||
| Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 126 | |
| 127 | #ifdef CONFIG_BLK_DEV_INITRD | ||||
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 128 | . = ALIGN(0x100); |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 129 | .init.ramfs : { |
| 130 | __initramfs_start = .; | ||||
| 131 | *(.init.ramfs) | ||||
| 132 | . = ALIGN(2); | ||||
| 133 | __initramfs_end = .; | ||||
| 134 | } | ||||
| Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 135 | #endif |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | |
| Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 137 | PERCPU(PAGE_SIZE) |
| 138 | . = ALIGN(PAGE_SIZE); | ||||
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 139 | __init_end = .; /* freed after init ends here */ |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | |
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 141 | /* BSS */ |
| 142 | .bss : { | ||||
| 143 | __bss_start = .; | ||||
| 144 | *(.bss) | ||||
| 145 | . = ALIGN(2); | ||||
| 146 | __bss_stop = .; | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | } |
| 148 | |||||
| Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 149 | _end = . ; |
| 150 | |||||
| 151 | /* Sections to be discarded */ | ||||
| 152 | /DISCARD/ : { | ||||
| 153 | *(.exit.data) | ||||
| 154 | *(.exitcall.exit) | ||||
| 155 | } | ||||
| 156 | |||||
| 157 | /* Debugging sections. */ | ||||
| 158 | STABS_DEBUG | ||||
| 159 | DWARF_DEBUG | ||||
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | } |