blob: 0f41a8286378503a3708d78d79255ef41bde65fe [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* ld script to make s390 Linux kernel
2 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
3 */
4
Heiko Carstens0778dc32008-11-27 11:05:58 +01005#include <asm/thread_info.h>
Sam Ravnborg52480ee2007-10-12 16:11:50 +02006#include <asm/page.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <asm-generic/vmlinux.lds.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Linus Torvalds1da177e2005-04-16 15:20:36 -07009OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
10OUTPUT_ARCH(s390:64-bit)
Christian Borntraegere0a15d52012-01-18 18:03:39 +010011ENTRY(startup)
Linus Torvalds1da177e2005-04-16 15:20:36 -070012jiffies = jiffies_64;
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010014PHDRS {
15 text PT_LOAD FLAGS(5); /* R_E */
16 data PT_LOAD FLAGS(7); /* RWE */
17 note PT_NOTE FLAGS(0); /* ___ */
18}
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020SECTIONS
21{
Sam Ravnborge16af092007-10-12 16:11:49 +020022 . = 0x00000000;
23 .text : {
24 _text = .; /* Text and read-only data */
Tim Abbott2133bb82009-04-25 22:11:06 -040025 HEAD_TEXT
26 TEXT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020027 SCHED_TEXT
28 LOCK_TEXT
29 KPROBES_TEXT
Heiko Carstens88dbd202009-06-12 10:26:46 +020030 IRQENTRY_TEXT
Alexander Potapenkobe7635e2016-03-25 14:22:05 -070031 SOFTIRQENTRY_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020032 *(.fixup)
33 *(.gnu.warning)
Heiko Carstensa817a612008-02-05 16:50:38 +010034 } :text = 0x0700
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Sam Ravnborge16af092007-10-12 16:11:49 +020036 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010038 NOTES :text :note
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010039
Martin Schwidefsky7a2512b2011-11-14 11:19:02 +010040 .dummy : { *(.dummy) } :data
41
Heiko Carstens56280b12012-07-24 16:32:39 +020042 RO_DATA_SECTION(PAGE_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
44#ifdef CONFIG_SHARED_KERNEL
Sam Ravnborg52480ee2007-10-12 16:11:50 +020045 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070046#endif
47
Sam Ravnborg52480ee2007-10-12 16:11:50 +020048 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020049 _eshared = .; /* End of shareable data */
Heiko Carstensdfcc3e62009-10-06 10:33:57 +020050 _sdata = .; /* Start of data section */
Heiko Carstens162e0062007-02-05 21:18:41 +010051
Nelson Elhage04a95f62009-09-11 10:28:44 +020052 EXCEPTION_TABLE(16) :data
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Nelson Elhage04a95f62009-09-11 10:28:44 +020054 RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
Sam Ravnborge16af092007-10-12 16:11:49 +020056 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020057
Sam Ravnborge16af092007-10-12 16:11:49 +020058 /* will be freed after init */
Sam Ravnborg52480ee2007-10-12 16:11:50 +020059 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborge16af092007-10-12 16:11:49 +020060 __init_begin = .;
Nelson Elhage04a95f62009-09-11 10:28:44 +020061
62 INIT_TEXT_SECTION(PAGE_SIZE)
63
Sam Ravnborge16af092007-10-12 16:11:49 +020064 /*
65 * .exit.text is discarded at runtime, not link time,
66 * to deal with references from __bug_table
67 */
68 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010069 EXIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020070 }
71
Heiko Carstensa4e69242013-02-11 14:26:24 +010072 .exit.data : {
73 EXIT_DATA
74 }
75
Christian Borntraeger92e6ecf2009-03-26 15:23:58 +010076 /* early.c uses stsi, which requires page aligned data. */
77 . = ALIGN(PAGE_SIZE);
Nelson Elhage04a95f62009-09-11 10:28:44 +020078 INIT_DATA_SECTION(0x100)
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
Tejun Heo0415b00d12011-03-24 18:50:09 +010080 PERCPU_SECTION(0x100)
Sam Ravnborg52480ee2007-10-12 16:11:50 +020081 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020082 __init_end = .; /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
Nelson Elhage04a95f62009-09-11 10:28:44 +020084 BSS_SECTION(0, 2, 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
Sam Ravnborge16af092007-10-12 16:11:49 +020086 _end = . ;
87
Sam Ravnborge16af092007-10-12 16:11:49 +020088 /* Debugging sections. */
89 STABS_DEBUG
90 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +090091
92 /* Sections to be discarded */
93 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -070094}