blob: 56fe6bc81fee45804a61c37fb189ccf73a0b72e8 [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")
11OUTPUT_ARCH(s390)
12ENTRY(_start)
13jiffies = jiffies_64 + 4;
14#else
15OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
16OUTPUT_ARCH(s390:64-bit)
17ENTRY(_start)
18jiffies = 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
Sam Ravnborge16af092007-10-12 16:11:49 +020046 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48#ifdef CONFIG_SHARED_KERNEL
Sam Ravnborg52480ee2007-10-12 16:11:50 +020049 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#endif
51
Sam Ravnborg52480ee2007-10-12 16:11:50 +020052 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020053 _eshared = .; /* End of shareable data */
Heiko Carstensdfcc3e62009-10-06 10:33:57 +020054 _sdata = .; /* Start of data section */
Heiko Carstens162e0062007-02-05 21:18:41 +010055
Nelson Elhage04a95f62009-09-11 10:28:44 +020056 EXCEPTION_TABLE(16) :data
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Nelson Elhage04a95f62009-09-11 10:28:44 +020058 RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Sam Ravnborge16af092007-10-12 16:11:49 +020060 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020061
Sam Ravnborge16af092007-10-12 16:11:49 +020062 /* will be freed after init */
Sam Ravnborg52480ee2007-10-12 16:11:50 +020063 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborge16af092007-10-12 16:11:49 +020064 __init_begin = .;
Nelson Elhage04a95f62009-09-11 10:28:44 +020065
66 INIT_TEXT_SECTION(PAGE_SIZE)
67
Sam Ravnborge16af092007-10-12 16:11:49 +020068 /*
69 * .exit.text is discarded at runtime, not link time,
70 * to deal with references from __bug_table
71 */
72 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010073 EXIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020074 }
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}