1 /* Default linker script, for normal executables */ 2 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", 3 "elf32-littlearm") 4 OUTPUT_ARCH(arm) 5 ENTRY(_start) 6 SEARCH_DIR("/usr/local/armdev/arm-elf/lib"); 7 /* Do we need any of these for elf? 8 __DYNAMIC = 0; */ 9 SECTIONS 10 { 11 /* Read-only sections, merged into text segment: */ 12 /* PROVIDE (__executable_start = 0x8000); . = 0x8000; */ 13 . = 0 + SIZEOF_HEADERS; 14 .interp : { *(.interp) } 15 .init : 16 { 17 KEEP (*(.init)) 18 } =0 19 .plt : { *(.plt) } 20 .text : 21 { 22 *(.text .stub .text.* .gnu.linkonce.t.*) 23 KEEP (*(.text.*personality*)) 24 /* .gnu.warning sections are handled specially by elf32.em. */ 25 *(.gnu.warning) 26 *(.glue_7t) *(.glue_7) 27 } =0 28 .fini : 29 { 30 KEEP (*(.fini)) 31 } =0 32 PROVIDE (__etext = .); 33 PROVIDE (_etext = .); 34 PROVIDE (etext = .); 35 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 36 .rodata1 : { *(.rodata1) } 37 .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } 38 __exidx_start = .; 39 .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } 40 __exidx_end = .; 41 .eh_frame_hdr : { *(.eh_frame_hdr) } 42 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 43 .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } 44 /* Adjust the address for the data segment. We want to adjust up to 45 the same address within the page on the next page up. */ 46 . = ALIGN(256) + (. & (256 - 1)); 47 /* Exception handling */ 48 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 49 .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } 50 /* Thread Local Storage sections */ 51 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } 52 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } 53 /* Ensure the __preinit_array_start label is properly aligned. We 54 could instead move the label definition inside the section, but 55 the linker would then create the section even if it turns out to 56 be empty, which isn't pretty. */ 57 . = ALIGN(32 / 8); 58 PROVIDE (__preinit_array_start = .); 59 .preinit_array : { KEEP (*(.preinit_array)) } 60 PROVIDE (__preinit_array_end = .); 61 PROVIDE (__init_array_start = .); 62 .init_array : { KEEP (*(.init_array)) } 63 PROVIDE (__init_array_end = .); 64 PROVIDE (__fini_array_start = .); 65 .fini_array : { KEEP (*(.fini_array)) } 66 PROVIDE (__fini_array_end = .); 67 .ctors : 68 { 69 /* gcc uses crtbegin.o to find the start of 70 the constructors, so we make sure it is 71 first. Because this is a wildcard, it 72 doesn't matter if the user does not 73 actually link against crtbegin.o; the 74 linker won't look for a file to match a 75 wildcard. The wildcard also means that it 76 doesn't matter which directory crtbegin.o 77 is in. */ 78 KEEP (*crtbegin*.o(.ctors)) 79 /* We don't want to include the .ctor section from 80 from the crtend.o file until after the sorted ctors. 81 The .ctor section from the crtend file contains the 82 end of ctors marker and it must be last */ 83 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) 84 KEEP (*(SORT(.ctors.*))) 85 KEEP (*(.ctors)) 86 } 87 .dtors : 88 { 89 KEEP (*crtbegin*.o(.dtors)) 90 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) 91 KEEP (*(SORT(.dtors.*))) 92 KEEP (*(.dtors)) 93 } 94 .jcr : { KEEP (*(.jcr)) } 95 .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } 96 .got : { *(.got.plt) *(.got) } 97 .data : 98 { 99 __data_start = . ; 100 *(.data .data.* .gnu.linkonce.d.*) 101 KEEP (*(.gnu.linkonce.d.*personality*)) 102 SORT(CONSTRUCTORS) 103 } 104 .data1 : { *(.data1) } 105 _edata = .; 106 PROVIDE (edata = .); 107 .dynamic : { *(.dynamic) } 108 .hash : { *(.hash) } 109 .dynsym : { *(.dynsym) } 110 .dynstr : { *(.dynstr) } 111 /* .shstrtab : { *(.shstrtab) } */ 112 .rel.plt : { *(.rel.plt) } 113 .rel.dyn : { *(.rel.*) } 114 __bss_start = .; 115 __bss_start__ = .; 116 .bss : 117 { 118 *(.dynbss) 119 *(.bss .bss.* .gnu.linkonce.b.*) 120 *(COMMON) 121 /* Align here to ensure that the .bss section occupies space up to 122 _end. Align after .bss to ensure correct alignment even if the 123 .bss section disappears because there are no input sections. */ 124 . = ALIGN(32 / 8); 125 } 126 . = ALIGN(32 / 8); 127 _end = .; 128 _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; 129 PROVIDE (end = .); 130 /* Stabs debugging sections. */ 131 .stab 0 : { *(.stab) } 132 .stabstr 0 : { *(.stabstr) } 133 .stab.excl 0 : { *(.stab.excl) } 134 .stab.exclstr 0 : { *(.stab.exclstr) } 135 .stab.index 0 : { *(.stab.index) } 136 .stab.indexstr 0 : { *(.stab.indexstr) } 137 /* DWARF debug sections. 138 Symbols in the DWARF debugging sections are relative to the beginning 139 of the section so we begin them at 0. */ 140 /* DWARF 1 */ 141 .debug 0 : { *(.debug) } 142 .line 0 : { *(.line) } 143 /* GNU DWARF 1 extensions */ 144 .debug_srcinfo 0 : { *(.debug_srcinfo) } 145 .debug_sfnames 0 : { *(.debug_sfnames) } 146 /* DWARF 1.1 and DWARF 2 */ 147 .debug_aranges 0 : { *(.debug_aranges) } 148 .debug_pubnames 0 : { *(.debug_pubnames) } 149 /* DWARF 2 */ 150 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 151 .debug_abbrev 0 : { *(.debug_abbrev) } 152 .debug_line 0 : { *(.debug_line) } 153 .debug_frame 0 : { *(.debug_frame) } 154 .debug_str 0 : { *(.debug_str) } 155 .debug_loc 0 : { *(.debug_loc) } 156 .debug_macinfo 0 : { *(.debug_macinfo) } 157 /* SGI/MIPS DWARF 2 extensions */ 158 .debug_weaknames 0 : { *(.debug_weaknames) } 159 .debug_funcnames 0 : { *(.debug_funcnames) } 160 .debug_typenames 0 : { *(.debug_typenames) } 161 .debug_varnames 0 : { *(.debug_varnames) } 162 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 163 /DISCARD/ : { *(.note.GNU-stack) *(.comment*) *(.stack*) *(.shstrtab) } 164 } 165