1 /* Script for ld -r: link without relocation */ 2 /* Copyright (C) 2014-2016 Free Software Foundation, Inc. 3 Copying and distribution of this script, with or without modification, 4 are permitted in any medium without royalty provided the copyright 5 notice and this notice are preserved. */ 6 OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", 7 "elf32-littlearm") 8 OUTPUT_ARCH(arm) 9 /* For some reason, the Solaris linker makes bad executables 10 if gld -r is used and the intermediate file has sections starting 11 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld 12 bug. But for now assigning the zero vmas works. */ 13 SECTIONS 14 { 15 /* Read-only sections, merged into text segment: */ 16 .interp 0 : { *(.interp) } 17 .note.gnu.build-id : { *(.note.gnu.build-id) } 18 .hash 0 : { *(.hash) } 19 .gnu.hash 0 : { *(.gnu.hash) } 20 .dynsym 0 : { *(.dynsym) } 21 .dynstr 0 : { *(.dynstr) } 22 .gnu.version 0 : { *(.gnu.version) } 23 .gnu.version_d 0: { *(.gnu.version_d) } 24 .gnu.version_r 0: { *(.gnu.version_r) } 25 .rel.init 0 : { *(.rel.init) } 26 .rela.init 0 : { *(.rela.init) } 27 .rel.text 0 : { *(.rel.text) } 28 .rela.text 0 : { *(.rela.text) } 29 .rel.fini 0 : { *(.rel.fini) } 30 .rela.fini 0 : { *(.rela.fini) } 31 .rel.rodata 0 : { *(.rel.rodata) } 32 .rela.rodata 0 : { *(.rela.rodata) } 33 .rel.data.rel.ro 0 : { *(.rel.data.rel.ro) } 34 .rela.data.rel.ro 0 : { *(.rela.data.rel.ro) } 35 .rel.data 0 : { *(.rel.data) } 36 .rela.data 0 : { *(.rela.data) } 37 .rel.tdata 0 : { *(.rel.tdata) } 38 .rela.tdata 0 : { *(.rela.tdata) } 39 .rel.tbss 0 : { *(.rel.tbss) } 40 .rela.tbss 0 : { *(.rela.tbss) } 41 .rel.ctors 0 : { *(.rel.ctors) } 42 .rela.ctors 0 : { *(.rela.ctors) } 43 .rel.dtors 0 : { *(.rel.dtors) } 44 .rela.dtors 0 : { *(.rela.dtors) } 45 .rel.got 0 : { *(.rel.got) } 46 .rela.got 0 : { *(.rela.got) } 47 .rel.bss 0 : { *(.rel.bss) } 48 .rela.bss 0 : { *(.rela.bss) } 49 .rel.iplt 0 : 50 { 51 *(.rel.iplt) 52 } 53 .rela.iplt 0 : 54 { 55 *(.rela.iplt) 56 } 57 .rel.plt 0 : 58 { 59 *(.rel.plt) 60 } 61 .rela.plt 0 : 62 { 63 *(.rela.plt) 64 } 65 .init 0 : 66 { 67 KEEP (*(SORT_NONE(.init))) 68 } 69 .plt 0 : { *(.plt) } 70 .iplt 0 : { *(.iplt) } 71 .text 0 : 72 { 73 *(.text .stub) 74 /* .gnu.warning sections are handled specially by elf32.em. */ 75 *(.gnu.warning) 76 } 77 .fini 0 : 78 { 79 KEEP (*(SORT_NONE(.fini))) 80 } 81 .rodata 0 : { *(.rodata) } 82 .rodata1 0 : { *(.rodata1) } 83 .ARM.extab 0 : { *(.ARM.extab) } 84 .ARM.exidx 0 : { *(.ARM.exidx) } 85 .eh_frame_hdr : { *(.eh_frame_hdr) } 86 .eh_frame 0 : ONLY_IF_RO { KEEP (*(.eh_frame)) } 87 .gcc_except_table 0 : ONLY_IF_RO { *(.gcc_except_table 88 .gcc_except_table.*) } 89 .gnu_extab 0 : ONLY_IF_RO { *(.gnu_extab*) } 90 /* These sections are generated by the Sun/Oracle C++ compiler. */ 91 .exception_ranges 0 : ONLY_IF_RO { *(.exception_ranges 92 .exception_ranges*) } 93 /* Adjust the address for the data segment. We want to adjust up to 94 the same address within the page on the next page up. */ 95 /* Exception handling */ 96 .eh_frame 0 : ONLY_IF_RW { KEEP (*(.eh_frame)) } 97 .gnu_extab 0 : ONLY_IF_RW { *(.gnu_extab) } 98 .gcc_except_table 0 : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 99 .exception_ranges 0 : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 100 /* Thread Local Storage sections */ 101 .tdata 0 : { *(.tdata) } 102 .tbss 0 : { *(.tbss) } 103 .preinit_array 0 : 104 { 105 KEEP (*(.preinit_array)) 106 } 107 .jcr 0 : { KEEP (*(.jcr)) } 108 .dynamic 0 : { *(.dynamic) } 109 .got 0 : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) } 110 .data 0 : 111 { 112 *(.data) 113 } 114 .data1 0 : { *(.data1) } 115 .bss 0 : 116 { 117 *(.dynbss) 118 *(.bss) 119 *(COMMON) 120 /* Align here to ensure that the .bss section occupies space up to 121 _end. Align after .bss to ensure correct alignment even if the 122 .bss section disappears because there are no input sections. 123 FIXME: Why do we need it? When there is no .bss section, we don't 124 pad the .data section. */ 125 } 126 /* Stabs debugging sections. */ 127 .stab 0 : { *(.stab) } 128 .stabstr 0 : { *(.stabstr) } 129 .stab.excl 0 : { *(.stab.excl) } 130 .stab.exclstr 0 : { *(.stab.exclstr) } 131 .stab.index 0 : { *(.stab.index) } 132 .stab.indexstr 0 : { *(.stab.indexstr) } 133 .comment 0 : { *(.comment) } 134 /* DWARF debug sections. 135 Symbols in the DWARF debugging sections are relative to the beginning 136 of the section so we begin them at 0. */ 137 /* DWARF 1 */ 138 .debug 0 : { *(.debug) } 139 .line 0 : { *(.line) } 140 /* GNU DWARF 1 extensions */ 141 .debug_srcinfo 0 : { *(.debug_srcinfo) } 142 .debug_sfnames 0 : { *(.debug_sfnames) } 143 /* DWARF 1.1 and DWARF 2 */ 144 .debug_aranges 0 : { *(.debug_aranges) } 145 .debug_pubnames 0 : { *(.debug_pubnames) } 146 /* DWARF 2 */ 147 .debug_info 0 : { *(.debug_info) } 148 .debug_abbrev 0 : { *(.debug_abbrev) } 149 .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } 150 .debug_frame 0 : { *(.debug_frame) } 151 .debug_str 0 : { *(.debug_str) } 152 .debug_loc 0 : { *(.debug_loc) } 153 .debug_macinfo 0 : { *(.debug_macinfo) } 154 /* SGI/MIPS DWARF 2 extensions */ 155 .debug_weaknames 0 : { *(.debug_weaknames) } 156 .debug_funcnames 0 : { *(.debug_funcnames) } 157 .debug_typenames 0 : { *(.debug_typenames) } 158 .debug_varnames 0 : { *(.debug_varnames) } 159 /* DWARF 3 */ 160 .debug_pubtypes 0 : { *(.debug_pubtypes) } 161 .debug_ranges 0 : { *(.debug_ranges) } 162 /* DWARF Extension. */ 163 .debug_macro 0 : { *(.debug_macro) } 164 .debug_addr 0 : { *(.debug_addr) } 165 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } 166 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 167 } 168