1/* Default linker script, for normal executables */ 2/* From binutils-2.19 */ 3OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", 4 "elf32-sparc") 5OUTPUT_ARCH(sparc) 6ENTRY(_start) 7 8 9PHDRS 10{ 11 phdr PT_PHDR PHDRS; 12 interp PT_INTERP; 13 ro PT_LOAD FILEHDR PHDRS; 14 rw PT_LOAD; 15 dyn PT_DYNAMIC; 16 ehf PT_GNU_EH_FRAME; 17 L4_DEFINE_L4PHDRS 18} 19 20SECTIONS 21{ 22 /* Read-only sections, merged into text segment: */ 23 PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x10000)); . = SEGMENT_START("text-segment", 0x10000) + SIZEOF_HEADERS; 24 .interp : { *(.interp) } 25 .note.gnu.build-id : { *(.note.gnu.build-id) } 26 .hash : { *(.hash) } 27 .gnu.hash : { *(.gnu.hash) } 28 .dynsym : { *(.dynsym) } 29 .dynstr : { *(.dynstr) } 30 .gnu.version : { *(.gnu.version) } 31 .gnu.version_d : { *(.gnu.version_d) } 32 .gnu.version_r : { *(.gnu.version_r) } 33 .rel.init : { *(.rel.init) } 34 .rela.init : { *(.rela.init) } 35 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } 36 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } 37 .rel.fini : { *(.rel.fini) } 38 .rela.fini : { *(.rela.fini) } 39 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } 40 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } 41 .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) } 42 .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) } 43 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } 44 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } 45 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } 46 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } 47 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } 48 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } 49 .rel.ctors : { *(.rel.ctors) } 50 .rela.ctors : { *(.rela.ctors) } 51 .rel.dtors : { *(.rel.dtors) } 52 .rela.dtors : { *(.rela.dtors) } 53 .rel.got : { *(.rel.got) } 54 .rela.got : { *(.rela.got) } 55 .rela.got1 : { *(.rela.got1) } 56 .rela.got2 : { *(.rela.got2) } 57 .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } 58 .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } 59 .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } 60 .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } 61 .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } 62 .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } 63 .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } 64 .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } 65 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } 66 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } 67 .rel.plt : { *(.rel.plt) } 68 .rela.plt : { *(.rela.plt) } 69 .init : 70 { 71 KEEP (*(.init)) 72 } =0 73 .text : 74 { 75 *(.text .stub .text.* .gnu.linkonce.t.*) 76 . = ALIGN (16); 77 KEEP (*(.text.*personality*)) 78 /* .gnu.warning sections are handled specially by elf32.em. */ 79 *(.gnu.warning) 80 *(.glink) 81 } =0 82 .fini : 83 { 84 KEEP (*(.fini)) 85 } =0 86 PROVIDE (__etext = .); 87 PROVIDE (_etext = .); 88 PROVIDE (etext = .); 89 .rol4re_elf_aux : { 90 KEEP (*(.rol4re_elf_aux)) 91 } : ro : l4re_aux 92 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } : ro 93 .rodata1 : { *(.rodata1) } 94 .sdata2 : 95 { 96 PROVIDE (_SDA2_BASE_ = 32768); 97 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) 98 } 99 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } 100 .eh_frame_hdr : { *(.eh_frame_hdr) } 101 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 102 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } 103 /* Adjust the address for the data segment. We want to adjust up to 104 the same address within the page on the next page up. */ 105 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 106 /* Exception handling */ 107 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 108 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 109 /* Thread Local Storage sections */ 110 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } 111 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } 112 .preinit_array : 113 { 114 PROVIDE_HIDDEN (__preinit_array_start = .); 115 KEEP (*(.preinit_array)) 116 PROVIDE_HIDDEN (__preinit_array_end = .); 117 } 118 .init_array : 119 { 120 PROVIDE_HIDDEN (__init_array_start = .); 121 KEEP (*(SORT(.init_array.*))) 122 KEEP (*(.init_array)) 123 PROVIDE_HIDDEN (__init_array_end = .); 124 } 125 .fini_array : 126 { 127 PROVIDE_HIDDEN (__fini_array_start = .); 128 KEEP (*(.fini_array)) 129 KEEP (*(SORT(.fini_array.*))) 130 PROVIDE_HIDDEN (__fini_array_end = .); 131 } 132 133 .ctors : 134 { 135 /* gcc uses crtbegin.o to find the start of 136 the constructors, so we make sure it is 137 first. Because this is a wildcard, it 138 doesn't matter if the user does not 139 actually link against crtbegin.o; the 140 linker won't look for a file to match a 141 wildcard. The wildcard also means that it 142 doesn't matter which directory crtbegin.o 143 is in. */ 144 KEEP (*crtbegin.o(.ctors)) 145 KEEP (*crtbegin?.o(.ctors)) 146 /* We don't want to include the .ctor section from 147 the crtend.o file until after the sorted ctors. 148 The .ctor section from the crtend file contains the 149 end of ctors marker and it must be last */ 150 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) 151 KEEP (*(SORT(.ctors.*))) 152 KEEP (*(.ctors)) 153 } 154 .dtors : 155 { 156 KEEP (*crtbegin.o(.dtors)) 157 KEEP (*crtbegin?.o(.dtors)) 158 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) 159 KEEP (*(SORT(.dtors.*))) 160 KEEP (*(.dtors)) 161 } 162 __DTOR_END__ = .; 163 164 .jcr : { KEEP (*(.jcr)) } 165 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } 166 .got1 : { *(.got1) } 167 .got2 : { *(.got2) } 168 .dynamic : { *(.dynamic) } 169 .got : SPECIAL { *(.got) } 170 . = DATA_SEGMENT_RELRO_END (0, .); 171 .plt : SPECIAL { *(.plt) } 172 .data : 173 { 174 *(.data .data.* .gnu.linkonce.d.*) 175 KEEP (*(.gnu.linkonce.d.*personality*)) 176 SORT(CONSTRUCTORS) 177 } 178 .data1 : { *(.data1) } 179 .got : SPECIAL { *(.got) } 180 /* We want the small data sections together, so single-instruction offsets 181 can access them all, and initialized data all before uninitialized, so 182 we can shorten the on-disk segment size. */ 183 .sdata : 184 { 185 PROVIDE (_SDA_BASE_ = 32768); 186 *(.sdata .sdata.* .gnu.linkonce.s.*) 187 } 188 _edata = .; PROVIDE (edata = .); 189 __bss_start = .; 190 .sbss : 191 { 192 PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); 193 *(.dynsbss) 194 *(.sbss .sbss.* .gnu.linkonce.sb.*) 195 *(.scommon) 196 PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); 197 } 198 .plt : SPECIAL { *(.plt) } 199 .bss : 200 { 201 *(.dynbss) 202 *(.bss .bss.* .gnu.linkonce.b.*) 203 *(COMMON) 204 /* Align here to ensure that the .bss section occupies space up to 205 _end. Align after .bss to ensure correct alignment even if the 206 .bss section disappears because there are no input sections. 207 FIXME: Why do we need it? When there is no .bss section, we don't 208 pad the .data section. */ 209 . = ALIGN(. != 0 ? 32 / 8 : 1); 210 } 211 . = ALIGN(32 / 8); 212 . = ALIGN(32 / 8); 213 _end = .; PROVIDE (end = .); 214 . = DATA_SEGMENT_END (.); 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 .gnu.linkonce.wi.*) } 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 /* DWARF 3 */ 249 .debug_pubtypes 0 : { *(.debug_pubtypes) } 250 .debug_ranges 0 : { *(.debug_ranges) } 251 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } 252 /DISCARD/ : { *(.fixup) } 253 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) } 254} 255