blob: 35b13ed0af5fa24f2f36fb41040a9f2c08b5c144 [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
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -08009#ifndef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -070010OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
Heiko Carstensc985cb32012-10-18 11:11:01 +020011OUTPUT_ARCH(s390:31-bit)
Christian Borntraegere0a15d52012-01-18 18:03:39 +010012ENTRY(startup)
Linus Torvalds1da177e2005-04-16 15:20:36 -070013jiffies = jiffies_64 + 4;
14#else
15OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
16OUTPUT_ARCH(s390:64-bit)
Christian Borntraegere0a15d52012-01-18 18:03:39 +010017ENTRY(startup)
Linus Torvalds1da177e2005-04-16 15:20:36 -070018jiffies = jiffies_64;
19#endif
20
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010021PHDRS {
22 text PT_LOAD FLAGS(5); /* R_E */
23 data PT_LOAD FLAGS(7); /* RWE */
24 note PT_NOTE FLAGS(0); /* ___ */
25}
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027SECTIONS
28{
Sam Ravnborge16af092007-10-12 16:11:49 +020029 . = 0x00000000;
30 .text : {
31 _text = .; /* Text and read-only data */
Tim Abbott2133bb82009-04-25 22:11:06 -040032 HEAD_TEXT
33 TEXT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020034 SCHED_TEXT
35 LOCK_TEXT
36 KPROBES_TEXT
Heiko Carstens88dbd202009-06-12 10:26:46 +020037 IRQENTRY_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020038 *(.fixup)
39 *(.gnu.warning)
Heiko Carstensa817a612008-02-05 16:50:38 +010040 } :text = 0x0700
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
Sam Ravnborge16af092007-10-12 16:11:49 +020042 _etext = .; /* End of text section */
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010044 NOTES :text :note
Martin Schwidefskyea29ee12008-01-26 14:11:21 +010045
Martin Schwidefsky7a2512b2011-11-14 11:19:02 +010046 .dummy : { *(.dummy) } :data
47
Heiko Carstens56280b12012-07-24 16:32:39 +020048 RO_DATA_SECTION(PAGE_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50#ifdef CONFIG_SHARED_KERNEL
Sam Ravnborg52480ee2007-10-12 16:11:50 +020051 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070052#endif
53
Sam Ravnborg52480ee2007-10-12 16:11:50 +020054 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020055 _eshared = .; /* End of shareable data */
Heiko Carstensdfcc3e62009-10-06 10:33:57 +020056 _sdata = .; /* Start of data section */
Heiko Carstens162e0062007-02-05 21:18:41 +010057
Nelson Elhage04a95f62009-09-11 10:28:44 +020058 EXCEPTION_TABLE(16) :data
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Nelson Elhage04a95f62009-09-11 10:28:44 +020060 RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Sam Ravnborge16af092007-10-12 16:11:49 +020062 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020063
Sam Ravnborge16af092007-10-12 16:11:49 +020064 /* will be freed after init */
Sam Ravnborg52480ee2007-10-12 16:11:50 +020065 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborge16af092007-10-12 16:11:49 +020066 __init_begin = .;
Nelson Elhage04a95f62009-09-11 10:28:44 +020067
68 INIT_TEXT_SECTION(PAGE_SIZE)
69
Sam Ravnborge16af092007-10-12 16:11:49 +020070 /*
71 * .exit.text is discarded at runtime, not link time,
72 * to deal with references from __bug_table
73 */
74 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010075 EXIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020076 }
77
Heiko Carstensa4e69242013-02-11 14:26:24 +010078 .exit.data : {
79 EXIT_DATA
80 }
81
Christian Borntraeger92e6ecf2009-03-26 15:23:58 +010082 /* early.c uses stsi, which requires page aligned data. */
83 . = ALIGN(PAGE_SIZE);
Nelson Elhage04a95f62009-09-11 10:28:44 +020084 INIT_DATA_SECTION(0x100)
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
Tejun Heo0415b00d12011-03-24 18:50:09 +010086 PERCPU_SECTION(0x100)
Sam Ravnborg52480ee2007-10-12 16:11:50 +020087 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020088 __init_end = .; /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
Nelson Elhage04a95f62009-09-11 10:28:44 +020090 BSS_SECTION(0, 2, 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
Sam Ravnborge16af092007-10-12 16:11:49 +020092 _end = . ;
93
Sam Ravnborge16af092007-10-12 16:11:49 +020094 /* Debugging sections. */
95 STABS_DEBUG
96 DWARF_DEBUG
Tejun Heo023bf6f2009-07-09 11:27:40 +090097
98 /* Sections to be discarded */
99 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100}