1 /* Script for ld -r: link without relocation */ 2 OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips", 3 "elf32-ntradlittlemips") 4 OUTPUT_ARCH(mips) 5 /* For some reason, the Solaris linker makes bad executables 6 if gld -r is used and the intermediate file has sections starting 7 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld 8 bug. But for now assigning the zero vmas works. */ 9 SECTIONS 10 { 11 /* Read-only sections, merged into text segment: */ 12 .interp 0 : { *(.interp) } 13 .reginfo 0 : { *(.reginfo) } 14 .note.gnu.build-id : { *(.note.gnu.build-id) } 15 .dynamic 0 : { *(.dynamic) } 16 .hash 0 : { *(.hash) } 17 .gnu.hash 0 : { *(.gnu.hash) } 18 .dynsym 0 : { *(.dynsym) } 19 .dynstr 0 : { *(.dynstr) } 20 .gnu.version 0 : { *(.gnu.version) } 21 .gnu.version_d 0: { *(.gnu.version_d) } 22 .gnu.version_r 0: { *(.gnu.version_r) } 23 .rel.init 0 : { *(.rel.init) } 24 .rela.init 0 : { *(.rela.init) } 25 .rel.text 0 : { *(.rel.text) } 26 .rela.text 0 : { *(.rela.text) } 27 .rel.fini 0 : { *(.rel.fini) } 28 .rela.fini 0 : { *(.rela.fini) } 29 .rel.rodata 0 : { *(.rel.rodata) } 30 .rela.rodata 0 : { *(.rela.rodata) } 31 .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) } 32 .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) } 33 .rel.data 0 : { *(.rel.data) } 34 .rela.data 0 : { *(.rela.data) } 35 .rel.tdata 0 : { *(.rel.tdata) } 36 .rela.tdata 0 : { *(.rela.tdata) } 37 .rel.tbss 0 : { *(.rel.tbss) } 38 .rela.tbss 0 : { *(.rela.tbss) } 39 .rel.ctors 0 : { *(.rel.ctors) } 40 .rela.ctors 0 : { *(.rela.ctors) } 41 .rel.dtors 0 : { *(.rel.dtors) } 42 .rela.dtors 0 : { *(.rela.dtors) } 43 .rel.got 0 : { *(.rel.got) } 44 .rela.got 0 : { *(.rela.got) } 45 .rel.dyn 0 : { *(.rel.dyn) } 46 .rel.sdata 0 : { *(.rel.sdata) } 47 .rela.sdata 0 : { *(.rela.sdata) } 48 .rel.sbss 0 : { *(.rel.sbss) } 49 .rela.sbss 0 : { *(.rela.sbss) } 50 .rel.sdata2 0 : { *(.rel.sdata2) } 51 .rela.sdata2 0 : { *(.rela.sdata2) } 52 .rel.sbss2 0 : { *(.rel.sbss2) } 53 .rela.sbss2 0 : { *(.rela.sbss2) } 54 .rel.bss 0 : { *(.rel.bss) } 55 .rela.bss 0 : { *(.rela.bss) } 56 .rel.iplt 0 : 57 { 58 *(.rel.iplt) 59 } 60 .rela.iplt 0 : 61 { 62 *(.rela.iplt) 63 } 64 .rel.plt 0 : 65 { 66 *(.rel.plt) 67 } 68 .rela.plt 0 : 69 { 70 *(.rela.plt) 71 } 72 .init 0 : 73 { 74 KEEP (*(.init)) 75 } =0 76 .plt 0 : { *(.plt) } 77 .iplt 0 : { *(.iplt) } 78 .text 0 : 79 { 80 *(.text .stub) 81 /* .gnu.warning sections are handled specially by elf32.em. */ 82 *(.gnu.warning) 83 } =0 84 .fini 0 : 85 { 86 KEEP (*(.fini)) 87 } =0 88 .rodata 0 : { *(.rodata) } 89 .rodata1 0 : { *(.rodata1) } 90 .sdata2 0 : 91 { 92 *(.sdata2) 93 } 94 .sbss2 0 : { *(.sbss2) } 95 .eh_frame_hdr : { *(.eh_frame_hdr) } 96 .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } 97 .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } 98 /* Adjust the address for the data segment. We want to align at exactly 99 a page boundary to make life easier for apriori. */ 100 . = ALIGN(4096); 101 . = DATA_SEGMENT_ALIGN(4096,4096); 102 /* Exception handling */ 103 .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } 104 .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 105 /* Thread Local Storage sections */ 106 .tdata 0 : { *(.tdata) } 107 .tbss 0 : { *(.tbss) } 108 /* Ensure the __preinit_array_start label is properly aligned. We 109 could instead move the label definition inside the section, but 110 the linker would then create the section even if it turns out to 111 be empty, which isn't pretty. */ 112 . = ALIGN(32 / 8); 113 .preinit_array 0 : 114 { 115 KEEP (*(.preinit_array)) 116 } 117 .jcr 0 : { KEEP (*(.jcr)) } 118 .data 0 : 119 { 120 *(.data) 121 } 122 .data1 0 : { *(.data1) } 123 .got.plt 0 : { *(.got.plt) } 124 .got 0 : { *(.got) } 125 /* We want the small data sections together, so single-instruction offsets 126 can access them all, and initialized data all before uninitialized, so 127 we can shorten the on-disk segment size. */ 128 .sdata 0 : 129 { 130 *(.sdata) 131 } 132 .lit8 0 : { *(.lit8) } 133 .lit4 0 : { *(.lit4) } 134 .srdata 0 : { *(.srdata) } 135 .sbss 0 : 136 { 137 *(.dynsbss) 138 *(.sbss) 139 *(.scommon) 140 } 141 .bss 0 : 142 { 143 *(.dynbss) 144 *(.bss) 145 *(COMMON) 146 /* Align here to ensure that the .bss section occupies space up to 147 _end. Align after .bss to ensure correct alignment even if the 148 .bss section disappears because there are no input sections. */ 149 } 150 /* Stabs debugging sections. */ 151 .stab 0 : { *(.stab) } 152 .stabstr 0 : { *(.stabstr) } 153 .stab.excl 0 : { *(.stab.excl) } 154 .stab.exclstr 0 : { *(.stab.exclstr) } 155 .stab.index 0 : { *(.stab.index) } 156 .stab.indexstr 0 : { *(.stab.indexstr) } 157 .comment 0 : { *(.comment) } 158 /* DWARF debug sections. 159 Symbols in the DWARF debugging sections are relative to the beginning 160 of the section so we begin them at 0. */ 161 /* DWARF 1 */ 162 .debug 0 : { *(.debug) } 163 .line 0 : { *(.line) } 164 /* GNU DWARF 1 extensions */ 165 .debug_srcinfo 0 : { *(.debug_srcinfo .zdebug_srcinfo) } 166 .debug_sfnames 0 : { *(.debug_sfnames .zdebug_sfnames) } 167 /* DWARF 1.1 and DWARF 2 */ 168 .debug_aranges 0 : { *(.debug_aranges .zdebug_aranges) } 169 .debug_pubnames 0 : { *(.debug_pubnames .zdebug_pubnames) } 170 /* DWARF 2 */ 171 .debug_info 0 : { *(.debug_info .zdebug_info) } 172 .debug_abbrev 0 : { *(.debug_abbrev .zdebug_abbrev) } 173 .debug_line 0 : { *(.debug_line .zdebug_line) } 174 .debug_frame 0 : { *(.debug_frame .zdebug_frame) } 175 .debug_str 0 : { *(.debug_str .zdebug_str) } 176 .debug_loc 0 : { *(.debug_loc .zdebug_loc) } 177 .debug_macinfo 0 : { *(.debug_macinfo .zdebug_macinfo) } 178 /* SGI/MIPS DWARF 2 extensions */ 179 .debug_weaknames 0 : { *(.debug_weaknames .zdebug_weaknames) } 180 .debug_funcnames 0 : { *(.debug_funcnames .zdebug_funcnames) } 181 .debug_typenames 0 : { *(.debug_typenames .zdebug_typenames) } 182 .debug_varnames 0 : { *(.debug_varnames .zdebug_varnames) } 183 /* DWARF 3 */ 184 .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) } 185 .debug_ranges 0 : { *(.debug_ranges .zdebug_ranges) } 186 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } 187 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } 188 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } 189 } 190