Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 1 | /* |
| 2 | * ld script to make SuperH Linux kernel |
| 3 | * Written by Niibe Yutaka and Paul Mundt |
| 4 | */ |
| 5 | #ifdef CONFIG_SUPERH64 |
Paul Mundt | 19f6b8b | 2010-02-12 15:41:45 +0900 | [diff] [blame] | 6 | #define LOAD_OFFSET PAGE_OFFSET |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 7 | OUTPUT_ARCH(sh:sh5) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #else |
Paul Mundt | 7b022d0 | 2009-05-10 00:25:08 +0900 | [diff] [blame] | 9 | #define LOAD_OFFSET 0 |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 10 | OUTPUT_ARCH(sh) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 11 | #endif |
| 12 | |
| 13 | #include <asm/thread_info.h> |
| 14 | #include <asm/cache.h> |
Matt Fleming | bd35386 | 2009-08-14 01:58:43 +0900 | [diff] [blame] | 15 | #include <asm/vmlinux.lds.h> |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 16 | |
Paul Mundt | 1d5cfcd | 2010-02-16 21:43:38 +0900 | [diff] [blame] | 17 | #ifdef CONFIG_PMB |
| 18 | #define MEMORY_OFFSET 0 |
Paul Mundt | 04c8697 | 2010-02-15 16:10:57 +0900 | [diff] [blame] | 19 | #else |
Paul Mundt | 1d5cfcd | 2010-02-16 21:43:38 +0900 | [diff] [blame] | 20 | #define MEMORY_OFFSET __MEMORY_START |
Paul Mundt | 04c8697 | 2010-02-15 16:10:57 +0900 | [diff] [blame] | 21 | #endif |
| 22 | |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 23 | ENTRY(_start) |
| 24 | SECTIONS |
| 25 | { |
Simon Horman | e66ac3f | 2011-09-15 20:13:00 +0900 | [diff] [blame] | 26 | . = PAGE_OFFSET + MEMORY_OFFSET + PHYSICAL_OFFSET + CONFIG_ZERO_PAGE_OFFSET; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 27 | |
Magnus Damm | 53c0054 | 2009-05-11 08:45:27 +0000 | [diff] [blame] | 28 | _text = .; /* Text and read-only data */ |
| 29 | |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 30 | .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) { |
| 31 | *(.empty_zero_page) |
| 32 | } = 0 |
| 33 | |
| 34 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 35 | HEAD_TEXT |
| 36 | TEXT_TEXT |
Paul Mundt | 19f6b8b | 2010-02-12 15:41:45 +0900 | [diff] [blame] | 37 | EXTRA_TEXT |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 38 | SCHED_TEXT |
| 39 | LOCK_TEXT |
| 40 | KPROBES_TEXT |
| 41 | IRQENTRY_TEXT |
| 42 | *(.fixup) |
| 43 | *(.gnu.warning) |
| 44 | _etext = .; /* End of text section */ |
| 45 | } = 0x0009 |
| 46 | |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 47 | EXCEPTION_TABLE(16) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 48 | NOTES |
Chris Smith | 660e2ac | 2010-01-27 22:03:11 +0900 | [diff] [blame] | 49 | |
| 50 | _sdata = .; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 51 | RO_DATA(PAGE_SIZE) |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 52 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
Chris Smith | 660e2ac | 2010-01-27 22:03:11 +0900 | [diff] [blame] | 53 | _edata = .; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 54 | |
Matt Fleming | bd35386 | 2009-08-14 01:58:43 +0900 | [diff] [blame] | 55 | DWARF_EH_FRAME |
| 56 | |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 57 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 58 | __init_begin = .; |
| 59 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 60 | INIT_DATA_SECTION(16) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 61 | |
| 62 | . = ALIGN(4); |
| 63 | .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) { |
| 64 | __machvec_start = .; |
| 65 | *(.machvec.init) |
| 66 | __machvec_end = .; |
| 67 | } |
| 68 | |
Tejun Heo | 0415b00 | 2011-03-24 18:50:09 +0100 | [diff] [blame] | 69 | PERCPU_SECTION(L1_CACHE_BYTES) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 70 | |
| 71 | /* |
| 72 | * .exit.text is discarded at runtime, not link time, to deal with |
| 73 | * references from __bug_table |
| 74 | */ |
| 75 | .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT } |
| 76 | .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA } |
| 77 | |
| 78 | . = ALIGN(PAGE_SIZE); |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 79 | __init_end = .; |
Tim Abbott | 6bde607 | 2009-07-20 23:30:24 +0900 | [diff] [blame] | 80 | BSS_SECTION(0, PAGE_SIZE, 4) |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 81 | _ebss = .; /* uClinux MTD sucks */ |
| 82 | _end = . ; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 83 | |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 84 | STABS_DEBUG |
| 85 | DWARF_DEBUG |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 86 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 87 | DISCARDS |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 88 | } |