blob: 7315f9e67e1db1ff9397e31fc667712244e42520 [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 Carstens162e0062007-02-05 21:18:41 +010054
Nelson Elhage04a95f62009-09-11 10:28:44 +020055 EXCEPTION_TABLE(16) :data
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
Nelson Elhage04a95f62009-09-11 10:28:44 +020057 RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Sam Ravnborge16af092007-10-12 16:11:49 +020059 _edata = .; /* End of data section */
Heiko Carstensc0007f12007-04-27 16:01:42 +020060
Sam Ravnborge16af092007-10-12 16:11:49 +020061 /* will be freed after init */
Sam Ravnborg52480ee2007-10-12 16:11:50 +020062 . = ALIGN(PAGE_SIZE); /* Init code and data */
Sam Ravnborge16af092007-10-12 16:11:49 +020063 __init_begin = .;
Nelson Elhage04a95f62009-09-11 10:28:44 +020064
65 INIT_TEXT_SECTION(PAGE_SIZE)
66
Sam Ravnborge16af092007-10-12 16:11:49 +020067 /*
68 * .exit.text is discarded at runtime, not link time,
69 * to deal with references from __bug_table
70 */
71 .exit.text : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010072 EXIT_TEXT
Sam Ravnborge16af092007-10-12 16:11:49 +020073 }
74
Christian Borntraeger92e6ecf2009-03-26 15:23:58 +010075 /* early.c uses stsi, which requires page aligned data. */
76 . = ALIGN(PAGE_SIZE);
Nelson Elhage04a95f62009-09-11 10:28:44 +020077 INIT_DATA_SECTION(0x100)
Linus Torvalds1da177e2005-04-16 15:20:36 -070078
Sam Ravnborg52480ee2007-10-12 16:11:50 +020079 PERCPU(PAGE_SIZE)
80 . = ALIGN(PAGE_SIZE);
Sam Ravnborge16af092007-10-12 16:11:49 +020081 __init_end = .; /* freed after init ends here */
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
Nelson Elhage04a95f62009-09-11 10:28:44 +020083 BSS_SECTION(0, 2, 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070084
Sam Ravnborge16af092007-10-12 16:11:49 +020085 _end = . ;
86
87 /* Sections to be discarded */
88 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010089 EXIT_DATA
Sam Ravnborge16af092007-10-12 16:11:49 +020090 *(.exitcall.exit)
91 }
92
93 /* Debugging sections. */
94 STABS_DEBUG
95 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -070096}