Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 1 | /* |
| 2 | * ld script for the c6x kernel |
| 3 | * |
| 4 | * Copyright (C) 2010, 2011 Texas Instruments Incorporated |
| 5 | * Mark Salter <msalter@redhat.com> |
| 6 | */ |
| 7 | #include <asm-generic/vmlinux.lds.h> |
| 8 | #include <asm/thread_info.h> |
| 9 | #include <asm/page.h> |
| 10 | |
| 11 | ENTRY(_c_int00) |
| 12 | |
| 13 | #if defined(CONFIG_CPU_BIG_ENDIAN) |
| 14 | jiffies = jiffies_64 + 4; |
| 15 | #else |
| 16 | jiffies = jiffies_64; |
| 17 | #endif |
| 18 | |
| 19 | #define READONLY_SEGMENT_START \ |
| 20 | . = PAGE_OFFSET; |
| 21 | #define READWRITE_SEGMENT_START \ |
| 22 | . = ALIGN(128); \ |
| 23 | _data_lma = .; |
| 24 | |
| 25 | SECTIONS |
| 26 | { |
| 27 | /* |
| 28 | * Start kernel read only segment |
| 29 | */ |
| 30 | READONLY_SEGMENT_START |
| 31 | |
| 32 | .vectors : |
| 33 | { |
| 34 | _vectors_start = .; |
| 35 | *(.vectors) |
| 36 | . = ALIGN(0x400); |
| 37 | _vectors_end = .; |
| 38 | } |
| 39 | |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 40 | /* |
| 41 | * This section contains data which may be shared with other |
| 42 | * cores. It needs to be a fixed offset from PAGE_OFFSET |
| 43 | * regardless of kernel configuration. |
| 44 | */ |
| 45 | .virtio_ipc_dev : |
| 46 | { |
| 47 | *(.virtio_ipc_dev) |
| 48 | } |
| 49 | |
| 50 | . = ALIGN(PAGE_SIZE); |
Jiang Liu | 06256f8 | 2013-07-03 15:03:35 -0700 | [diff] [blame] | 51 | __init_begin = .; |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 52 | .init : |
| 53 | { |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 54 | _sinittext = .; |
| 55 | HEAD_TEXT |
| 56 | INIT_TEXT |
| 57 | _einittext = .; |
| 58 | } |
| 59 | |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 60 | INIT_DATA_SECTION(16) |
| 61 | |
| 62 | PERCPU_SECTION(128) |
| 63 | |
| 64 | . = ALIGN(PAGE_SIZE); |
| 65 | __init_end = .; |
| 66 | |
| 67 | .text : |
| 68 | { |
| 69 | _text = .; |
Jiang Liu | 06256f8 | 2013-07-03 15:03:35 -0700 | [diff] [blame] | 70 | _stext = .; |
Aurelien Jacquiot | c278400 | 2011-10-04 10:54:51 -0400 | [diff] [blame] | 71 | TEXT_TEXT |
| 72 | SCHED_TEXT |
| 73 | LOCK_TEXT |
| 74 | IRQENTRY_TEXT |
| 75 | KPROBES_TEXT |
| 76 | *(.fixup) |
| 77 | *(.gnu.warning) |
| 78 | } |
| 79 | |
| 80 | EXCEPTION_TABLE(16) |
| 81 | NOTES |
| 82 | |
| 83 | RO_DATA_SECTION(PAGE_SIZE) |
| 84 | .const : |
| 85 | { |
| 86 | *(.const .const.* .gnu.linkonce.r.*) |
| 87 | *(.switch) |
| 88 | } |
| 89 | |
| 90 | . = ALIGN (8) ; |
| 91 | __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) |
| 92 | { |
| 93 | _fdt_start = . ; /* place for fdt blob */ |
| 94 | *(__fdt_blob) ; /* Any link-placed DTB */ |
| 95 | BYTE(0); /* section always has contents */ |
| 96 | . = _fdt_start + 0x4000; /* Pad up to 16kbyte */ |
| 97 | _fdt_end = . ; |
| 98 | } |
| 99 | |
| 100 | _etext = .; |
| 101 | |
| 102 | /* |
| 103 | * Start kernel read-write segment. |
| 104 | */ |
| 105 | READWRITE_SEGMENT_START |
| 106 | _sdata = .; |
| 107 | |
| 108 | .fardata : AT(ADDR(.fardata) - LOAD_OFFSET) |
| 109 | { |
| 110 | INIT_TASK_DATA(THREAD_SIZE) |
| 111 | NOSAVE_DATA |
| 112 | PAGE_ALIGNED_DATA(PAGE_SIZE) |
| 113 | CACHELINE_ALIGNED_DATA(128) |
| 114 | READ_MOSTLY_DATA(128) |
| 115 | DATA_DATA |
| 116 | CONSTRUCTORS |
| 117 | *(.data1) |
| 118 | *(.fardata .fardata.*) |
| 119 | *(.data.debug_bpt) |
| 120 | } |
| 121 | |
| 122 | .neardata ALIGN(8) : AT(ADDR(.neardata) - LOAD_OFFSET) |
| 123 | { |
| 124 | *(.neardata2 .neardata2.* .gnu.linkonce.s2.*) |
| 125 | *(.neardata .neardata.* .gnu.linkonce.s.*) |
| 126 | . = ALIGN(8); |
| 127 | } |
| 128 | |
| 129 | _edata = .; |
| 130 | |
| 131 | __bss_start = .; |
| 132 | SBSS(8) |
| 133 | BSS(8) |
| 134 | .far : |
| 135 | { |
| 136 | . = ALIGN(8); |
| 137 | *(.dynfar) |
| 138 | *(.far .far.* .gnu.linkonce.b.*) |
| 139 | . = ALIGN(8); |
| 140 | } |
| 141 | __bss_stop = .; |
| 142 | |
| 143 | _end = .; |
| 144 | |
| 145 | DWARF_DEBUG |
| 146 | |
| 147 | /DISCARD/ : |
| 148 | { |
| 149 | EXIT_TEXT |
| 150 | EXIT_DATA |
| 151 | EXIT_CALL |
| 152 | *(.discard) |
| 153 | *(.discard.*) |
| 154 | *(.interp) |
| 155 | } |
| 156 | } |