1OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") 2OUTPUT_ARCH(i386) 3ENTRY(_start) 4SECTIONS 5{ 6 . = 0; 7 ImageBase = .; 8 /* .hash and/or .gnu.hash MUST come first! */ 9 .hash : { *(.hash) } 10 .gnu.hash : { *(.gnu.hash) } 11 .eh_frame : { *(.eh_frame) } 12 .gcc_except_table : { *(.gcc_except_table*) } 13 . = ALIGN(4096); 14 .text : 15 { 16 _text = .; 17 *(.text) 18 *(.text.*) 19 *(.gnu.linkonce.t.*) 20 . = ALIGN(16); 21 } 22 _etext = .; 23 _text_size = . - _text; 24 . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 25 .sdata : 26 { 27 _data = .; 28 *(.got.plt) 29 *(.got) 30 *(.srodata) 31 *(.sdata) 32 *(.sbss) 33 *(.scommon) 34 } 35 . = ALIGN(4096); 36 .data : 37 { 38 *(.rodata*) 39 *(.data) 40 *(.data1) 41 *(.data.*) 42 *(.sdata) 43 *(.got.plt) 44 *(.got) 45 46 /* 47 * Note that these aren't the using the GNU "CONSTRUCTOR" output section 48 * command, so they don't start with a size. Because of p2align and the 49 * end/END definitions, and the fact that they're mergeable, they can also 50 * have NULLs which aren't guaranteed to be at the end. 51 */ 52 . = ALIGN(16); 53 _init_array = .; 54 *(SORT_BY_NAME(.init_array)) 55 _init_array_end = .; 56 __CTOR_LIST__ = .; 57 *(SORT_BY_NAME(.ctors)) 58 __CTOR_END__ = .; 59 __DTOR_LIST__ = .; 60 *(SORT_BY_NAME(.dtors)) 61 __DTOR_END__ = .; 62 _fini_array = .; 63 *(SORT_BY_NAME(.fini_array)) 64 _fini_array_end = .; 65 66 /* the EFI loader doesn't seem to like a .bss section, so we stick 67 it all into .data: */ 68 *(.sbss) 69 *(.scommon) 70 *(.dynbss) 71 *(.bss*) 72 *(COMMON) 73 } 74 .note.gnu.build-id : { *(.note.gnu.build-id) } 75 76 . = ALIGN(4096); 77 .dynamic : { *(.dynamic) } 78 . = ALIGN(4096); 79 .rel : 80 { 81 *(.rel.text*) 82 *(.rel.sdata*) 83 *(.rel.data*) 84 *(.rel.got) 85 *(.rel.dyn) 86 *(.rel.stab) 87 *(.data.rel.ro.local) 88 *(.data.rel.local) 89 *(.data.rel.ro) 90 *(.data.rel*) 91 } 92 . = ALIGN(4096); 93 .rel.plt : { *(.rel.plt) } 94 _edata = .; 95 _data_size = . - _etext; 96 . = ALIGN(4096); 97 .reloc : /* This is the PECOFF .reloc section! */ 98 { 99 KEEP (*(.reloc)) 100 } 101 . = ALIGN(4096); 102 .dynsym : { *(.dynsym) } 103 . = ALIGN(4096); 104 .dynstr : { *(.dynstr) } 105 . = ALIGN(4096); 106 . = DATA_SEGMENT_END (.); 107 /DISCARD/ : 108 { 109 *(.rel.reloc) 110 *(.note.GNU-stack) 111 } 112 .comment 0 : { *(.comment) } 113} 114