[15ebdf1f] | 1 | /* |
---|
[1c554014] | 2 | * linkcmds |
---|
[15ebdf1f] | 3 | */ |
---|
| 4 | |
---|
| 5 | /* |
---|
| 6 | * Declare some sizes. |
---|
| 7 | */ |
---|
[2bd5103] | 8 | RamBase = DEFINED(RamBase) ? RamBase : 0x80000000; |
---|
| 9 | RamSize = DEFINED(RamSize) ? RamSize : 4M; |
---|
[ffa1153] | 10 | RamEnd = RamBase + RamSize; |
---|
[2bd5103] | 11 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
[15ebdf1f] | 12 | |
---|
[f7626ef9] | 13 | ENTRY(start) |
---|
| 14 | STARTUP(start.o) |
---|
| 15 | |
---|
[15ebdf1f] | 16 | SECTIONS |
---|
| 17 | { |
---|
| 18 | /* 0x80000000 - 0x8001FFFF used by PMON (with 0x80010000 - 0x8001FFFF as heap for symbol storage) |
---|
| 19 | 0x80020000 - 0x8002FFFF reserved for shared memory |
---|
| 20 | 0x80030000 beginning of text (code) section |
---|
| 21 | */ |
---|
| 22 | .text 0x80030000 : |
---|
| 23 | { |
---|
| 24 | _ftext = . ; |
---|
| 25 | eprol = .; |
---|
| 26 | *(.text) |
---|
| 27 | *(.text.*) |
---|
| 28 | *(.gnu.linkonce.t*) |
---|
| 29 | *(.mips16.fn.*) |
---|
| 30 | *(.mips16.call.*) |
---|
| 31 | PROVIDE (__runtime_reloc_start = .); |
---|
| 32 | *(.rel.sdata) |
---|
| 33 | PROVIDE (__runtime_reloc_stop = .); |
---|
| 34 | |
---|
| 35 | /* |
---|
| 36 | * Special FreeBSD sysctl sections. |
---|
| 37 | */ |
---|
| 38 | . = ALIGN (16); |
---|
| 39 | __start_set_sysctl_set = .; |
---|
| 40 | *(set_sysctl_*); |
---|
| 41 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
| 42 | *(set_domain_*); |
---|
| 43 | *(set_pseudo_*); |
---|
| 44 | |
---|
[d1f57b5] | 45 | *(.gcc_except_table*) |
---|
[15ebdf1f] | 46 | *(.eh_frame_hdr) |
---|
| 47 | *(.eh_frame) |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | .init : |
---|
| 51 | { |
---|
| 52 | KEEP(*crti.o(.init)) |
---|
| 53 | KEEP(*(.init)) |
---|
| 54 | KEEP(*crtn.o(.init)) |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | .fini : |
---|
| 58 | { |
---|
| 59 | KEEP(*crti.o(.fini)) |
---|
| 60 | KEEP(*(.fini)) |
---|
| 61 | KEEP(*crtn.o(.fini)) |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | .ctors : |
---|
| 65 | { |
---|
| 66 | /* gcc uses crtbegin.o to find the start of |
---|
| 67 | the constructors, so we make sure it is |
---|
| 68 | first. Because this is a wildcard, it |
---|
| 69 | doesn't matter if the user does not |
---|
| 70 | actually link against crtbegin.o; the |
---|
| 71 | linker won't look for a file to match a |
---|
| 72 | wildcard. The wildcard also means that it |
---|
| 73 | doesn't matter which directory crtbegin.o |
---|
| 74 | is in. */ |
---|
| 75 | |
---|
| 76 | KEEP (*crtbegin.o(.ctors)) |
---|
| 77 | |
---|
| 78 | /* We don't want to include the .ctor section from |
---|
| 79 | from the crtend.o file until after the sorted ctors. |
---|
| 80 | The .ctor section from the crtend file contains the |
---|
| 81 | end of ctors marker and it must be last */ |
---|
| 82 | |
---|
| 83 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) |
---|
| 84 | KEEP (*(SORT(.ctors.*))) |
---|
| 85 | KEEP (*(.ctors)) |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | .dtors : |
---|
| 89 | { |
---|
| 90 | KEEP (*crtbegin.o(.dtors)) |
---|
| 91 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) |
---|
| 92 | KEEP (*(SORT(.dtors.*))) |
---|
| 93 | KEEP (*(.dtors)) |
---|
| 94 | |
---|
| 95 | etext = .; |
---|
| 96 | _etext = .; |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | .rdata : { |
---|
| 100 | *(.rdata) |
---|
| 101 | *(.rodata) |
---|
| 102 | *(.rodata.*) |
---|
[b618d8c] | 103 | KEEP (*(SORT(.rtemsroset.*))) |
---|
[15ebdf1f] | 104 | *(.gnu.linkonce.r*) |
---|
| 105 | } |
---|
[960fd85] | 106 | |
---|
| 107 | .tdata : { |
---|
| 108 | _TLS_Data_begin = .; |
---|
| 109 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
| 110 | _TLS_Data_end = .; |
---|
| 111 | } |
---|
| 112 | |
---|
| 113 | .tbss : { |
---|
| 114 | _TLS_BSS_begin = .; |
---|
| 115 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
| 116 | _TLS_BSS_end = .; |
---|
| 117 | } |
---|
| 118 | |
---|
| 119 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
[d60e760] | 120 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
| 121 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
[960fd85] | 122 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
| 123 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
[d60e760] | 124 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
[960fd85] | 125 | |
---|
[15ebdf1f] | 126 | _fdata = ALIGN(16); |
---|
| 127 | |
---|
| 128 | .data : { |
---|
| 129 | *(.data) |
---|
| 130 | *(.data.*) |
---|
[b618d8c] | 131 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
[15ebdf1f] | 132 | *(.gnu.linkonce.d*) |
---|
| 133 | SORT(CONSTRUCTORS) |
---|
| 134 | } |
---|
| 135 | . = ALIGN(8); |
---|
| 136 | |
---|
| 137 | .jcr : { |
---|
| 138 | KEEP (*(.jcr)) |
---|
| 139 | } |
---|
| 140 | |
---|
| 141 | _gp = ALIGN(16) + 0x8000; |
---|
| 142 | __global = _gp; |
---|
| 143 | |
---|
| 144 | .sdata : { |
---|
| 145 | *(.sdata) |
---|
| 146 | *(.sdata.*) |
---|
| 147 | *(.gnu.linkonce.s*) |
---|
| 148 | } |
---|
| 149 | .lit8 : { |
---|
| 150 | *(.lit8) |
---|
| 151 | } |
---|
| 152 | .lit4 : { |
---|
| 153 | *(.lit4) |
---|
| 154 | } |
---|
| 155 | |
---|
| 156 | edata = .; |
---|
| 157 | _edata = .; |
---|
| 158 | _fbss = .; |
---|
| 159 | |
---|
| 160 | .sbss : { |
---|
| 161 | *(.sbss) |
---|
| 162 | *(.scommon) |
---|
| 163 | } |
---|
[2b2e3ef5] | 164 | .bss : { |
---|
[15ebdf1f] | 165 | _bss_start = . ; |
---|
| 166 | *(.bss) |
---|
| 167 | *(COMMON) |
---|
| 168 | . = ALIGN (64); |
---|
| 169 | end = .; |
---|
| 170 | _end = .; |
---|
| 171 | } |
---|
| 172 | |
---|
[715d616] | 173 | .rtemsstack (NOLOAD) : { |
---|
| 174 | *(SORT(.rtemsstack.*)) |
---|
| 175 | WorkAreaBase = .; |
---|
| 176 | } |
---|
[15ebdf1f] | 177 | |
---|
| 178 | /* Debug sections. These should never be loadable, but they must have |
---|
| 179 | zero addresses for the debuggers to work correctly. */ |
---|
| 180 | .line 0 : { *(.line) } |
---|
| 181 | .debug 0 : { *(.debug) } |
---|
| 182 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
| 183 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
| 184 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
| 185 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
| 186 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
| 187 | } |
---|