[70d7eaa9] | 1 | /* |
---|
| 2 | FIXME: Why is a special linkcmds required for little endian? |
---|
| 3 | OUTPUT_FORMAT("elf32-shl", "elf32-shl", |
---|
[cd67dca] | 4 | "elf32-shl") |
---|
[70d7eaa9] | 5 | */ |
---|
[cd67dca] | 6 | OUTPUT_ARCH(sh) |
---|
| 7 | ENTRY(_start) |
---|
| 8 | /* Do we need any of these for elf? |
---|
| 9 | __DYNAMIC = 0; */ |
---|
| 10 | |
---|
| 11 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : (512 * 1024); |
---|
| 12 | _WorkspaceSize = DEFINED(_WorkspaceSize) ? _WorkspaceSize : (1024 * 1024); |
---|
| 13 | |
---|
| 14 | MEMORY |
---|
| 15 | { |
---|
| 16 | ram : o = 0x00000000, l = 0x01000000 |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | SECTIONS |
---|
| 20 | { |
---|
| 21 | /* Read-only sections, merged into text segment: */ |
---|
| 22 | /* . = 0x1000; */ |
---|
| 23 | . = 0x00004000 ; |
---|
| 24 | .interp : { *(.interp) } |
---|
| 25 | .hash : { *(.hash) } |
---|
| 26 | .dynsym : { *(.dynsym) } |
---|
| 27 | .dynstr : { *(.dynstr) } |
---|
| 28 | .gnu.version : { *(.gnu.version) } |
---|
| 29 | .gnu.version_d : { *(.gnu.version_d) } |
---|
| 30 | .gnu.version_r : { *(.gnu.version_r) } |
---|
| 31 | .rel.init : { *(.rel.init) } |
---|
[2758e1fc] | 32 | .rela.dyn : |
---|
| 33 | { |
---|
| 34 | *(.rela.init) |
---|
| 35 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
---|
| 36 | *(.rela.fini) |
---|
| 37 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
---|
| 38 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
---|
| 39 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
---|
| 40 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
---|
| 41 | *(.rela.ctors) |
---|
| 42 | *(.rela.dtors) |
---|
| 43 | *(.rela.got) |
---|
| 44 | *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) |
---|
| 45 | *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) |
---|
| 46 | *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) |
---|
| 47 | *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) |
---|
| 48 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
---|
| 49 | } >ram |
---|
[cd67dca] | 50 | .rel.text : |
---|
| 51 | { |
---|
| 52 | *(.rel.text) |
---|
| 53 | *(.rel.text.*) |
---|
| 54 | *(.rel.gnu.linkonce.t*) |
---|
| 55 | } |
---|
| 56 | .rel.fini : { *(.rel.fini) } |
---|
| 57 | .rel.rodata : |
---|
| 58 | { |
---|
| 59 | *(.rel.rodata) |
---|
| 60 | *(.rel.rodata.*) |
---|
| 61 | *(.rel.gnu.linkonce.r*) |
---|
| 62 | } |
---|
| 63 | .rel.data : |
---|
| 64 | { |
---|
| 65 | *(.rel.data) |
---|
| 66 | *(.rel.data.*) |
---|
| 67 | *(.rel.gnu.linkonce.d*) |
---|
| 68 | } |
---|
| 69 | .rel.ctors : { *(.rel.ctors) } |
---|
| 70 | .rel.dtors : { *(.rel.dtors) } |
---|
| 71 | .rel.got : { *(.rel.got) } |
---|
| 72 | .rel.sdata : |
---|
| 73 | { |
---|
| 74 | *(.rel.sdata) |
---|
| 75 | *(.rel.sdata.*) |
---|
| 76 | *(.rel.gnu.linkonce.s*) |
---|
| 77 | } |
---|
| 78 | .rel.sbss : { *(.rel.sbss) } |
---|
| 79 | .rel.bss : { *(.rel.bss) } |
---|
| 80 | .rel.plt : { *(.rel.plt) } |
---|
| 81 | .init : |
---|
| 82 | { |
---|
| 83 | KEEP (*(.init)) |
---|
| 84 | } =0 |
---|
| 85 | .plt : { *(.plt) } |
---|
| 86 | .text : |
---|
| 87 | { |
---|
| 88 | . = . + 16; |
---|
[350808f] | 89 | *(.text*) |
---|
[cd67dca] | 90 | *(.stub) |
---|
[296cc30e] | 91 | |
---|
| 92 | /* |
---|
| 93 | * Special FreeBSD sysctl sections. |
---|
| 94 | */ |
---|
| 95 | . = ALIGN (16); |
---|
[832d4bfd] | 96 | ___start_set_sysctl_set = .; |
---|
| 97 | *(set_sysc*); /* set_sysctl_* but name is truncated by SH-coff */ |
---|
| 98 | ___stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 99 | *(set_doma*); /* set_domain_* but name is truncated by SH-coff */ |
---|
[296cc30e] | 100 | *(set_pseudo_*); |
---|
| 101 | |
---|
[cd67dca] | 102 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
| 103 | *(.gnu.warning) |
---|
| 104 | *(.gnu.linkonce.t*) |
---|
| 105 | } > ram |
---|
| 106 | _etext = .; |
---|
| 107 | PROVIDE (etext = .); |
---|
| 108 | .fini : |
---|
| 109 | { |
---|
| 110 | KEEP (*(.fini)) |
---|
| 111 | } > ram |
---|
| 112 | .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) } > ram |
---|
| 113 | .rodata1 : { *(.rodata1) } > ram |
---|
| 114 | /* Adjust the address for the data segment. We want to adjust up to |
---|
| 115 | the same address within the page on the next page up. */ |
---|
| 116 | . = ALIGN(128) + (. & (128 - 1)); |
---|
| 117 | .data : |
---|
| 118 | { |
---|
| 119 | *(.data) |
---|
| 120 | *(.data.*) |
---|
[832d4bfd] | 121 | *(.gcc_exc) |
---|
| 122 | ___EH_FRAME_BEGIN__ = .; |
---|
| 123 | *(.eh_fram*) |
---|
| 124 | ___EH_FRAME_END__ = .; |
---|
| 125 | LONG(0); |
---|
[9d0a618] | 126 | *(.gcc_except_table*) |
---|
[cd67dca] | 127 | *(.gnu.linkonce.d*) |
---|
| 128 | SORT(CONSTRUCTORS) |
---|
| 129 | } > ram |
---|
| 130 | .data1 : { *(.data1) } > ram |
---|
| 131 | .ctors : |
---|
| 132 | { |
---|
| 133 | ___ctors = .; |
---|
| 134 | /* gcc uses crtbegin.o to find the start of |
---|
| 135 | the constructors, so we make sure it is |
---|
| 136 | first. Because this is a wildcard, it |
---|
| 137 | doesn't matter if the user does not |
---|
| 138 | actually link against crtbegin.o; the |
---|
| 139 | linker won't look for a file to match a |
---|
| 140 | wildcard. The wildcard also means that it |
---|
| 141 | doesn't matter which directory crtbegin.o |
---|
| 142 | is in. */ |
---|
| 143 | KEEP (*crtbegin.o(.ctors)) |
---|
| 144 | /* We don't want to include the .ctor section from |
---|
| 145 | from the crtend.o file until after the sorted ctors. |
---|
| 146 | The .ctor section from the crtend file contains the |
---|
| 147 | end of ctors marker and it must be last */ |
---|
| 148 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) |
---|
| 149 | KEEP (*(SORT(.ctors.*))) |
---|
| 150 | KEEP (*(.ctors)) |
---|
| 151 | ___ctors_end = .; |
---|
| 152 | } > ram |
---|
| 153 | .dtors : |
---|
| 154 | { |
---|
| 155 | ___dtors = .; |
---|
| 156 | KEEP (*crtbegin.o(.dtors)) |
---|
| 157 | KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) |
---|
| 158 | KEEP (*(SORT(.dtors.*))) |
---|
| 159 | KEEP (*(.dtors)) |
---|
| 160 | ___dtors_end = .; |
---|
| 161 | } > ram |
---|
| 162 | .got : { *(.got.plt) *(.got) } |
---|
| 163 | .dynamic : { *(.dynamic) } |
---|
| 164 | /* We want the small data sections together, so single-instruction offsets |
---|
| 165 | can access them all, and initialized data all before uninitialized, so |
---|
| 166 | we can shorten the on-disk segment size. */ |
---|
| 167 | .sdata : |
---|
| 168 | { |
---|
| 169 | *(.sdata) |
---|
| 170 | *(.sdata.*) |
---|
| 171 | *(.gnu.linkonce.s.*) |
---|
| 172 | } > ram |
---|
| 173 | _edata = .; |
---|
| 174 | PROVIDE (edata = .); |
---|
| 175 | __bss_start = .; |
---|
| 176 | .sbss : |
---|
| 177 | { |
---|
| 178 | *(.dynsbss) |
---|
[350808f] | 179 | *(.sbss*) |
---|
[cd67dca] | 180 | *(.scommon) |
---|
| 181 | } > ram |
---|
| 182 | .bss : |
---|
| 183 | { |
---|
| 184 | *(.dynbss) |
---|
[7c11146a] | 185 | *(.bss .bss* .gnu.linkonce.b*) |
---|
[cd67dca] | 186 | *(COMMON) |
---|
| 187 | /* Align here to ensure that the .bss section occupies space up to |
---|
| 188 | _end. Align after .bss to ensure correct alignment even if the |
---|
| 189 | .bss section disappears because there are no input sections. */ |
---|
| 190 | . = ALIGN(32 / 8); |
---|
| 191 | } > ram |
---|
| 192 | . = ALIGN(32 / 8); |
---|
| 193 | _end = .; |
---|
| 194 | PROVIDE (end = .); |
---|
| 195 | |
---|
| 196 | . = ALIGN(16); |
---|
| 197 | _HeapStart = . ; |
---|
| 198 | . = . + _HeapSize ; |
---|
| 199 | PROVIDE( _HeapEnd = . ); |
---|
| 200 | |
---|
| 201 | . = ALIGN(16); |
---|
| 202 | _WorkSpaceStart = . ; |
---|
| 203 | . = . + _WorkspaceSize ; |
---|
| 204 | PROVIDE(_WorkSpaceEnd = .); |
---|
| 205 | |
---|
| 206 | . = ALIGN(16); |
---|
| 207 | .stack . : { |
---|
| 208 | . = . + 4096; |
---|
| 209 | } |
---|
| 210 | |
---|
| 211 | . = ALIGN(16); |
---|
| 212 | _CPU_Interrupt_stack_low = . ; |
---|
| 213 | _CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ; |
---|
| 214 | |
---|
| 215 | /* Stabs debugging sections. */ |
---|
| 216 | .stab 0 : { *(.stab) } |
---|
| 217 | .stabstr 0 : { *(.stabstr) } |
---|
| 218 | .stab.excl 0 : { *(.stab.excl) } |
---|
| 219 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
| 220 | .stab.index 0 : { *(.stab.index) } |
---|
| 221 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
| 222 | .comment 0 : { *(.comment) } |
---|
| 223 | /* DWARF debug sections. |
---|
| 224 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
| 225 | of the section so we begin them at 0. */ |
---|
| 226 | /* DWARF 1 */ |
---|
| 227 | .debug 0 : { *(.debug) } |
---|
| 228 | .line 0 : { *(.line) } |
---|
| 229 | /* GNU DWARF 1 extensions */ |
---|
| 230 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 231 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 232 | /* DWARF 1.1 and DWARF 2 */ |
---|
| 233 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 234 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 235 | /* DWARF 2 */ |
---|
| 236 | .debug_info 0 : { *(.debug_info) } |
---|
| 237 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
| 238 | .debug_line 0 : { *(.debug_line) } |
---|
| 239 | .debug_frame 0 : { *(.debug_frame) } |
---|
| 240 | .debug_str 0 : { *(.debug_str) } |
---|
| 241 | .debug_loc 0 : { *(.debug_loc) } |
---|
| 242 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 243 | /* SGI/MIPS DWARF 2 extensions */ |
---|
| 244 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
| 245 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
| 246 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
| 247 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
| 248 | .stack 0x30000 : { _stack = .; *(.stack) } |
---|
| 249 | /* These must appear regardless of . */ |
---|
| 250 | } |
---|