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 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 9 | #ifndef CONFIG_64BIT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") |
| 11 | OUTPUT_ARCH(s390) |
| 12 | ENTRY(_start) |
| 13 | jiffies = jiffies_64 + 4; |
| 14 | #else |
| 15 | OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") |
| 16 | OUTPUT_ARCH(s390:64-bit) |
| 17 | ENTRY(_start) |
| 18 | jiffies = jiffies_64; |
| 19 | #endif |
| 20 | |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 21 | PHDRS { |
| 22 | text PT_LOAD FLAGS(5); /* R_E */ |
| 23 | data PT_LOAD FLAGS(7); /* RWE */ |
| 24 | note PT_NOTE FLAGS(0); /* ___ */ |
| 25 | } |
| 26 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | SECTIONS |
| 28 | { |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 29 | . = 0x00000000; |
| 30 | .text : { |
| 31 | _text = .; /* Text and read-only data */ |
Tim Abbott | 2133bb8 | 2009-04-25 22:11:06 -0400 | [diff] [blame] | 32 | HEAD_TEXT |
| 33 | TEXT_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 34 | SCHED_TEXT |
| 35 | LOCK_TEXT |
| 36 | KPROBES_TEXT |
Heiko Carstens | 88dbd20 | 2009-06-12 10:26:46 +0200 | [diff] [blame] | 37 | IRQENTRY_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 38 | *(.fixup) |
| 39 | *(.gnu.warning) |
Heiko Carstens | a817a61 | 2008-02-05 16:50:38 +0100 | [diff] [blame] | 40 | } :text = 0x0700 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 42 | _etext = .; /* End of text section */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 44 | NOTES :text :note |
Martin Schwidefsky | ea29ee1 | 2008-01-26 14:11:21 +0100 | [diff] [blame] | 45 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 46 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
| 48 | #ifdef CONFIG_SHARED_KERNEL |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 49 | . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #endif |
| 51 | |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 52 | . = ALIGN(PAGE_SIZE); |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 53 | _eshared = .; /* End of shareable data */ |
Heiko Carstens | dfcc3e6 | 2009-10-06 10:33:57 +0200 | [diff] [blame] | 54 | _sdata = .; /* Start of data section */ |
Heiko Carstens | 162e006 | 2007-02-05 21:18:41 +0100 | [diff] [blame] | 55 | |
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 56 | EXCEPTION_TABLE(16) :data |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | |
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 58 | RW_DATA_SECTION(0x100, PAGE_SIZE, THREAD_SIZE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 60 | _edata = .; /* End of data section */ |
Heiko Carstens | c0007f1 | 2007-04-27 16:01:42 +0200 | [diff] [blame] | 61 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 62 | /* will be freed after init */ |
Sam Ravnborg | 52480ee | 2007-10-12 16:11:50 +0200 | [diff] [blame] | 63 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 64 | __init_begin = .; |
Nelson Elhage | 04a95f6 | 2009-09-11 10:28:44 +0200 | [diff] [blame] | 65 | |
| 66 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 67 | |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 68 | /* |
| 69 | * .exit.text is discarded at runtime, not link time, |
| 70 | * to deal with references from __bug_table |
| 71 | */ |
| 72 | .exit.text : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 73 | EXIT_TEXT |
Sam Ravnborg | e16af09 | 2007-10-12 16:11:49 +0200 | [diff] [blame] | 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 | } |