1OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") 2OUTPUT_ARCH(arm) 3 4ENTRY(_start) 5SECTIONS 6{ 7 . = 0x80000000 + SIZEOF_HEADERS; 8 9 .interp : { *(.interp) } 10 .note.gnu.build-id : { *(.note.gnu.build-id) } 11 .hash : { *(.hash) } 12 .gnu.hash : { *(.gnu.hash) } 13 .dynsym : { *(.dynsym) } 14 .dynstr : { *(.dynstr) } 15 .gnu.version : { *(.gnu.version) } 16 .gnu.version_d : { *(.gnu.version_d) } 17 .gnu.version_r : { *(.gnu.version_r) } 18 .rela.dyn : 19 { 20 *(.rela.init) 21 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) 22 *(.rela.fini) 23 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) 24 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) 25 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) 26 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) 27 *(.rela.ctors) 28 *(.rela.dtors) 29 *(.rela.got) 30 *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) 31 *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) 32 *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) 33 *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) 34 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) 35 PROVIDE_HIDDEN (__rela_iplt_start = .); 36 *(.rela.iplt) 37 PROVIDE_HIDDEN (__rela_iplt_end = .); 38 } 39 .rela.plt : 40 { 41 *(.rela.plt) 42 } 43 .init : 44 { 45 KEEP (*(SORT_NONE(.init))) 46 } 47 .plt : { *(.plt) } 48 .iplt : { *(.iplt) } 49 .text : 50 { 51 *(.text.unlikely .text.*_unlikely .text.unlikely.*) 52 *(.text.exit .text.exit.*) 53 *(.text.startup .text.startup.*) 54 *(.text.hot .text.hot.*) 55 *(.text .stub .text.* .gnu.linkonce.t.*) 56 /* .gnu.warning sections are handled specially by elf32.em. */ 57 *(.gnu.warning) 58 } 59 .fini : 60 { 61 KEEP (*(SORT_NONE(.fini))) 62 } 63 PROVIDE (__etext = .); 64 PROVIDE (_etext = .); 65 PROVIDE (etext = .); 66 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 67 .rodata1 : { *(.rodata1) } 68 .sdata2 : 69 { 70 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) 71 } 72 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } 73 .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } 74 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } 75 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table 76 .gcc_except_table.*) } 77 .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } 78 /* Adjust the address for the data segment. We want to adjust up to 79 * the same address within the page on the next page up. */ 80 . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 81 /* Exception handling */ 82 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } 83 .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } 84 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 85 .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 86 /* Thread Local Storage sections */ 87 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } 88 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } 89 .preinit_array : 90 { 91 PROVIDE_HIDDEN (__preinit_array_start = .); 92 KEEP (*(.preinit_array)) 93 PROVIDE_HIDDEN (__preinit_array_end = .); 94 } 95 .init_array : 96 { 97 PROVIDE_HIDDEN (__init_array_start = .); 98 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 99 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) 100 PROVIDE_HIDDEN (__init_array_end = .); 101 } 102 .fini_array : 103 { 104 PROVIDE_HIDDEN (__fini_array_start = .); 105 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 106 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) 107 PROVIDE_HIDDEN (__fini_array_end = .); 108 } 109 .ctors : 110 { 111 /* gcc uses crtbegin.o to find the start of 112 * the constructors, so we make sure it is 113 * first. Because this is a wildcard, it 114 * doesn't matter if the user does not 115 * actually link against crtbegin.o; the 116 * linker won't look for a file to match a 117 * wildcard. The wildcard also means that it 118 * doesn't matter which directory crtbegin.o 119 * is in. */ 120 KEEP (*crtbegin.o(.ctors)) 121 KEEP (*crtbegin?.o(.ctors)) 122 /* We don't want to include the .ctor section from 123 * the crtend.o file until after the sorted ctors. 124 * The .ctor section from the crtend file contains the 125 * end of ctors marker and it must be last */ 126 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) 127 KEEP (*(SORT(.ctors.*))) 128 KEEP (*(.ctors)) 129 } 130 .dtors : 131 { 132 KEEP (*crtbegin.o(.dtors)) 133 KEEP (*crtbegin?.o(.dtors)) 134 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) 135 KEEP (*(SORT(.dtors.*))) 136 KEEP (*(.dtors)) 137 } 138 .jcr : { KEEP (*(.jcr)) } 139 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) } 140 .dynamic : { *(.dynamic) } 141 . = DATA_SEGMENT_RELRO_END (0, .); 142 .data : 143 { 144 *(.data .data.* .gnu.linkonce.d.*) 145 SORT(CONSTRUCTORS) 146 } 147 .data1 : { *(.data1) } 148 .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) } 149 /* We want the small data sections together, so single-instruction offsets 150 * can access them all, and initialized data all before uninitialized, so 151 * we can shorten the on-disk segment size. */ 152 .sdata : 153 { 154 __global_pointer$ = . + 0x800; 155 *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) 156 *(.sdata .sdata.* .gnu.linkonce.s.*) 157 } 158 _edata = .; PROVIDE (edata = .); 159 . = .; 160 __bss_start = .; 161 .sbss : 162 { 163 *(.dynsbss) 164 *(.sbss .sbss.* .gnu.linkonce.sb.*) 165 *(.scommon) 166 } 167 .bss : 168 { 169 *(.dynbss) 170 *(.bss .bss.* .gnu.linkonce.b.*) 171 *(COMMON) 172 /* Align here to ensure that the .bss section occupies space up to 173 * _end. Align after .bss to ensure correct alignment even if the 174 * .bss section disappears because there are no input sections. 175 * FIXME: Why do we need it? When there is no .bss section, we don't 176 * pad the .data section. */ 177 . = ALIGN(. != 0 ? 64 / 8 : 1); 178 } 179 . = ALIGN(64 / 8); 180 . = SEGMENT_START("ldata-segment", .); 181 . = ALIGN(64 / 8); 182 _end = .; PROVIDE (end = .); 183 . = DATA_SEGMENT_END (.); 184 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.ARM.exidx*) } 185} 186