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 | |||||
Heiko Carstens | 0778dc3 | 2008-11-27 11:05:58 +0100 | [diff] [blame] | 5 | #include <asm/thread_info.h> |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 6 | #include <asm/page.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include <asm-generic/vmlinux.lds.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") |
10 | OUTPUT_ARCH(s390:64-bit) | ||||
Christian Borntraeger | e0a15d5 | 2012-01-18 18:03:39 +0100 | [diff] [blame] | 11 | ENTRY(startup) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | jiffies = jiffies_64; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 14 | PHDRS { |
15 | text PT_LOAD FLAGS(5); /* R_E */ | ||||
16 | data PT_LOAD FLAGS(7); /* RWE */ | ||||
17 | note PT_NOTE FLAGS(0); /* ___ */ | ||||
18 | } | ||||
19 | |||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 */ | ||||
Tim Abbott | 2133bb8 | 2009-04-25 22:11:06 -0400 | [diff] [blame] | 25 | HEAD_TEXT |
26 | TEXT_TEXT | ||||
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 27 | SCHED_TEXT |
28 | LOCK_TEXT | ||||
29 | KPROBES_TEXT | ||||
Heiko Carstens | 88dbd20 | 2009-06-12 10:26:46 +0200 | [diff] [blame] | 30 | IRQENTRY_TEXT |
Alexander Potapenko | be7635e | 2016-03-25 14:22:05 -0700 | [diff] [blame^] | 31 | SOFTIRQENTRY_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 32 | *(.fixup) |
33 | *(.gnu.warning) | ||||
Heiko Carstens | a817a61 | 2008-02-05 16:50:38 +0100 | [diff] [blame] | 34 | } :text = 0x0700 |
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 | _etext = .; /* End of text section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 38 | NOTES :text :note |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 39 | |
Martin Schwidefsky | 7a2512b | 2011-11-14 11:19:02 +0100 | [diff] [blame] | 40 | .dummy : { *(.dummy) } :data |
41 | |||||
Heiko Carstens | 56280b1 | 2012-07-24 16:32:39 +0200 | [diff] [blame] | 42 | RO_DATA_SECTION(PAGE_SIZE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
44 | #ifdef CONFIG_SHARED_KERNEL | ||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 45 | . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | #endif |
47 | |||||
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 48 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 49 | _eshared = .; /* End of shareable data */ |
Heiko Carstens | dfcc3e6 | 2009-10-06 10:33:57 +0200 | [diff] [blame] | 50 | _sdata = .; /* Start of data section */ |
Heiko Carstens | 162e006 | 2007-02-05 21:18:41 +0100 | [diff] [blame] | 51 | |
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 52 | EXCEPTION_TABLE(16) :data |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 54 | RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 56 | _edata = .; /* End of data section */ |
Heiko Carstens | c0007f1 | 2007-04-27 16:01:42 +0200 | [diff] [blame] | 57 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 58 | /* will be freed after init */ |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 59 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 60 | __init_begin = .; |
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 61 | |
62 | INIT_TEXT_SECTION(PAGE_SIZE) | ||||
63 | |||||
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 64 | /* |
65 | * .exit.text is discarded at runtime, not link time, | ||||
66 | * to deal with references from __bug_table | ||||
67 | */ | ||||
68 | .exit.text : { | ||||
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 69 | EXIT_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 70 | } |
71 | |||||
Heiko Carstens | a4e6924 | 2013-02-11 14:26:24 +0100 | [diff] [blame] | 72 | .exit.data : { |
73 | EXIT_DATA | ||||
74 | } | ||||
75 | |||||
Christian Borntraeger | 92e6ecf | 2009-03-26 15:23:58 +0100 | [diff] [blame] | 76 | /* early.c uses stsi, which requires page aligned data. */ |
77 | . = ALIGN(PAGE_SIZE); | ||||
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 78 | INIT_DATA_SECTION(0x100) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | |
Tejun Heo | 0415b00d1 | 2011-03-24 18:50:09 +0100 | [diff] [blame] | 80 | PERCPU_SECTION(0x100) |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 81 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 82 | __init_end = .; /* freed after init ends here */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | |
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 84 | BSS_SECTION(0, 2, 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 86 | _end = . ; |
87 | |||||
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 88 | /* Debugging sections. */ |
89 | STABS_DEBUG | ||||
90 | DWARF_DEBUG | ||||
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 91 | |
92 | /* Sections to be discarded */ | ||||
93 | DISCARDS | ||||
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | } |