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 |
| 6 | #define LOAD_OFFSET CONFIG_PAGE_OFFSET |
| 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 | |
| 17 | ENTRY(_start) |
| 18 | SECTIONS |
| 19 | { |
| 20 | #ifdef CONFIG_PMB_FIXED |
| 21 | . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) + |
| 22 | CONFIG_ZERO_PAGE_OFFSET; |
| 23 | #elif defined(CONFIG_32BIT) |
| 24 | . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET; |
| 25 | #else |
| 26 | . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; |
| 27 | #endif |
| 28 | |
Magnus Damm | 53c0054 | 2009-05-11 08:45:27 +0000 | [diff] [blame] | 29 | _text = .; /* Text and read-only data */ |
| 30 | |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 31 | .empty_zero_page : AT(ADDR(.empty_zero_page) - LOAD_OFFSET) { |
| 32 | *(.empty_zero_page) |
| 33 | } = 0 |
| 34 | |
| 35 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 36 | HEAD_TEXT |
| 37 | TEXT_TEXT |
| 38 | |
| 39 | #ifdef CONFIG_SUPERH64 |
| 40 | *(.text64) |
| 41 | *(.text..SHmedia32) |
| 42 | #endif |
| 43 | |
| 44 | SCHED_TEXT |
| 45 | LOCK_TEXT |
| 46 | KPROBES_TEXT |
| 47 | IRQENTRY_TEXT |
| 48 | *(.fixup) |
| 49 | *(.gnu.warning) |
| 50 | _etext = .; /* End of text section */ |
| 51 | } = 0x0009 |
| 52 | |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 53 | EXCEPTION_TABLE(16) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 54 | |
| 55 | NOTES |
| 56 | RO_DATA(PAGE_SIZE) |
| 57 | |
| 58 | /* |
| 59 | * Code which must be executed uncached and the associated data |
| 60 | */ |
| 61 | . = ALIGN(PAGE_SIZE); |
| 62 | .uncached : AT(ADDR(.uncached) - LOAD_OFFSET) { |
| 63 | __uncached_start = .; |
| 64 | *(.uncached.text) |
| 65 | *(.uncached.data) |
| 66 | __uncached_end = .; |
| 67 | } |
| 68 | |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 69 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 70 | |
| 71 | _edata = .; /* End of data section */ |
| 72 | |
Matt Fleming | bd35386 | 2009-08-14 01:58:43 +0900 | [diff] [blame^] | 73 | DWARF_EH_FRAME |
| 74 | |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 75 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 76 | __init_begin = .; |
| 77 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 78 | INIT_DATA_SECTION(16) |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 79 | |
| 80 | . = ALIGN(4); |
| 81 | .machvec.init : AT(ADDR(.machvec.init) - LOAD_OFFSET) { |
| 82 | __machvec_start = .; |
| 83 | *(.machvec.init) |
| 84 | __machvec_end = .; |
| 85 | } |
| 86 | |
| 87 | PERCPU(PAGE_SIZE) |
| 88 | |
| 89 | /* |
| 90 | * .exit.text is discarded at runtime, not link time, to deal with |
| 91 | * references from __bug_table |
| 92 | */ |
| 93 | .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { EXIT_TEXT } |
| 94 | .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { EXIT_DATA } |
| 95 | |
| 96 | . = ALIGN(PAGE_SIZE); |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 97 | __init_end = .; |
Tim Abbott | 6bde607 | 2009-07-20 23:30:24 +0900 | [diff] [blame] | 98 | BSS_SECTION(0, PAGE_SIZE, 4) |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 99 | _ebss = .; /* uClinux MTD sucks */ |
| 100 | _end = . ; |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 101 | |
| 102 | /* |
| 103 | * When something in the kernel is NOT compiled as a module, the |
| 104 | * module cleanup code and data are put into these segments. Both |
| 105 | * can then be thrown away, as cleanup code is never called unless |
| 106 | * it's a module. |
| 107 | */ |
| 108 | /DISCARD/ : { |
Tim Abbott | 2802e34 | 2009-07-09 14:45:59 +0000 | [diff] [blame] | 109 | EXIT_CALL |
Paul Mundt | dce97c8 | 2009-05-09 23:36:10 +0900 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | STABS_DEBUG |
| 113 | DWARF_DEBUG |
| 114 | } |