
1: /* Default linker script, for normal executables */ 2: OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", 3: "elf32-tradlittlemips") 4: OUTPUT_ARCH(mips) 5: ENTRY(__start) 6: SEARCH_DIR("/usr/mips-linux-gnu/lib"); 7: SECTIONS 8: { 9: /* Read-only sections, merged into text segment: */ 10: PROVIDE (__executable_start = 0x0400000); . = 0x0400000 + SIZEOF_HEADERS; 11: .interp : { *(.interp) } 12: .reginfo : { *(.reginfo) } 13: .dynamic : { *(.dynamic) } 14: .hash : { *(.hash) } 15: .dynsym : { *(.dynsym) } 16: .dynstr : { *(.dynstr) } 17: .gnu.version : { *(.gnu.version) } 18: .gnu.version_d : { *(.gnu.version_d) } 19: .gnu.version_r : { *(.gnu.version_r) } 20: .rel.init : { *(.rel.init) } 21: .rela.init : { *(.rela.init) } 22: .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } 23: .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } 24: .rel.fini : { *(.rel.fini) } 25: .rela.fini : { *(.rela.fini) } 26: .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } 27: .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } 28: .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) } 29: .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) } 30: .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } 31: .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } 32: .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } 33: .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } 34: .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } 35: .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } 36: .rel.ctors : { *(.rel.ctors) } 37: .rela.ctors : { *(.rela.ctors) } 38: .rel.dtors : { *(.rel.dtors) } 39: .rela.dtors : { *(.rela.dtors) } 40: .rel.got : { *(.rel.got) } 41: .rela.got : { *(.rela.got) } 42: .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } 43: .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } 44: .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } 45: .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } 46: .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } 47: .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } 48: .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } 49: .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } 50: .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } 51: .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } 52: .rel.plt : { *(.rel.plt) } 53: .rela.plt : { *(.rela.plt) } 54: .init : 55: { 56: KEEP (*(.init)) 57: } =0x47ff041f 58: .plt : { *(.plt) } 59: .text : 60: { 61: _ftext = . ; 62: *(.text .stub .text.* .gnu.linkonce.t.*) 63: KEEP (*(.text.*personality*)) 64: /* .gnu.warning sections are handled specially by elf32.em. */ 65: *(.gnu.warning) 66: *(.mips16.fn.*) *(.mips16.call.*) 67: } =0x47ff041f 68: .fini : 69: { 70: KEEP (*(.fini)) 71: } =0x47ff041f 72: PROVIDE (__etext = .); 73: PROVIDE (_etext = .); 74: PROVIDE (etext = .); 75: .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 76: .rodata1 : { *(.rodata1) } 77: .sdata2 : 78: { 79: *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) 80: } 81: .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } 82: .eh_frame_hdr : { *(.eh_frame_hdr) } 83: .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 84: .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } 85: /* Adjust the address for the data segment. We want to adjust up to 86: the same address within the page on the next page up. */ 87: . = ALIGN (0x40000) - ((0x40000 - .) & (0x40000 - 1)); . = DATA_SEGMENT_ALIGN (0x40000, 0x1000); 88: /* Exception handling */ 89: .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 90: .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 91: /* Thread Local Storage sections */ 92: .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } 93: .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } 94: .preinit_array : 95: { 96: PROVIDE_HIDDEN (__preinit_array_start = .); 97: KEEP (*(.preinit_array)) 98: PROVIDE_HIDDEN (__preinit_array_end = .); 99: } 100: .init_array : 101: { 102: PROVIDE_HIDDEN (__init_array_start = .); 103: KEEP (*(SORT(.init_array.*))) 104: KEEP (*(.init_array)) 105: PROVIDE_HIDDEN (__init_array_end = .); 106: } 107: .fini_array : 108: { 109: PROVIDE_HIDDEN (__fini_array_start = .); 110: KEEP (*(.fini_array)) 111: KEEP (*(SORT(.fini_array.*))) 112: PROVIDE_HIDDEN (__fini_array_end = .); 113: } 114: .ctors : 115: { 116: /* gcc uses crtbegin.o to find the start of 117: the constructors, so we make sure it is 118: first. Because this is a wildcard, it 119: doesn't matter if the user does not 120: actually link against crtbegin.o; the 121: linker won't look for a file to match a 122: wildcard. The wildcard also means that it 123: doesn't matter which directory crtbegin.o 124: is in. */ 125: KEEP (*crtbegin*.o(.ctors)) 126: /* We don't want to include the .ctor section from 127: the crtend.o file until after the sorted ctors. 128: The .ctor section from the crtend file contains the 129: end of ctors marker and it must be last */ 130: KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) 131: KEEP (*(SORT(.ctors.*))) 132: KEEP (*(.ctors)) 133: } 134: .dtors : 135: { 136: KEEP (*crtbegin*.o(.dtors)) 137: KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) 138: KEEP (*(SORT(.dtors.*))) 139: KEEP (*(.dtors)) 140: } 141: .jcr : { KEEP (*(.jcr)) } 142: .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } 143: . = DATA_SEGMENT_RELRO_END (0, .); 144: .data : 145: { 146: _fdata = . ; 147: *(.data .data.* .gnu.linkonce.d.*) 148: KEEP (*(.gnu.linkonce.d.*personality*)) 149: SORT(CONSTRUCTORS) 150: } 151: .data1 : { *(.data1) } 152: . = .; 153: _gp = ALIGN(16) + 0x7ff0; 154: .got : { *(.got.plt) *(.got) } 155: /* We want the small data sections together, so single-instruction offsets 156: can access them all, and initialized data all before uninitialized, so 157: we can shorten the on-disk segment size. */ 158: .sdata : 159: { 160: *(.sdata .sdata.* .gnu.linkonce.s.*) 161: } 162: .lit8 : { *(.lit8) } 163: .lit4 : { *(.lit4) } 164: _edata = .; PROVIDE (edata = .); 165: __bss_start = .; 166: _fbss = .; 167: .sbss : 168: { 169: *(.dynsbss) 170: *(.sbss .sbss.* .gnu.linkonce.sb.*) 171: *(.scommon) 172: } 173: .bss : 174: { 175: *(.dynbss) 176: *(.bss .bss.* .gnu.linkonce.b.*) 177: *(COMMON) 178: /* Align here to ensure that the .bss section occupies space up to 179: _end. Align after .bss to ensure correct alignment even if the 180: .bss section disappears because there are no input sections. 181: FIXME: Why do we need it? When there is no .bss section, we don't 182: pad the .data section. */ 183: . = ALIGN(. != 0 ? 32 / 8 : 1); 184: } 185: . = ALIGN(32 / 8); 186: . = ALIGN(32 / 8); 187: _end = .; PROVIDE (end = .); 188: . = DATA_SEGMENT_END (.); 189: /* Stabs debugging sections. */ 190: .stab 0 : { *(.stab) } 191: .stabstr 0 : { *(.stabstr) } 192: .stab.excl 0 : { *(.stab.excl) } 193: .stab.exclstr 0 : { *(.stab.exclstr) } 194: .stab.index 0 : { *(.stab.index) } 195: .stab.indexstr 0 : { *(.stab.indexstr) } 196: .comment 0 : { *(.comment) } 197: /* DWARF debug sections. 198: Symbols in the DWARF debugging sections are relative to the beginning 199: of the section so we begin them at 0. */ 200: /* DWARF 1 */ 201: .debug 0 : { *(.debug) } 202: .line 0 : { *(.line) } 203: /* GNU DWARF 1 extensions */ 204: .debug_srcinfo 0 : { *(.debug_srcinfo) } 205: .debug_sfnames 0 : { *(.debug_sfnames) } 206: /* DWARF 1.1 and DWARF 2 */ 207: .debug_aranges 0 : { *(.debug_aranges) } 208: .debug_pubnames 0 : { *(.debug_pubnames) } 209: /* DWARF 2 */ 210: .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 211: .debug_abbrev 0 : { *(.debug_abbrev) } 212: .debug_line 0 : { *(.debug_line) } 213: .debug_frame 0 : { *(.debug_frame) } 214: .debug_str 0 : { *(.debug_str) } 215: .debug_loc 0 : { *(.debug_loc) } 216: .debug_macinfo 0 : { *(.debug_macinfo) } 217: /* SGI/MIPS DWARF 2 extensions */ 218: .debug_weaknames 0 : { *(.debug_weaknames) } 219: .debug_funcnames 0 : { *(.debug_funcnames) } 220: .debug_typenames 0 : { *(.debug_typenames) } 221: .debug_varnames 0 : { *(.debug_varnames) } 222: .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } 223: .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } 224: /DISCARD/ : { *(.note.GNU-stack) } 225: }