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 = _etext - _text; 24 . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 25 .data : 26 { 27 _data = .; 28 *(.got.plt) 29 *(.got) 30 *(.data) 31 *(.data1) 32 *(.data.*) 33 34 /* 35 * Note that these aren't the using the GNU "CONSTRUCTOR" output section 36 * command, so they don't start with a size. Because of p2align and the 37 * end/END definitions, and the fact that they're mergeable, they can also 38 * have NULLs which aren't guaranteed to be at the end. 39 */ 40 . = ALIGN(16); 41 __init_array_start = .; 42 *(SORT(.init_array.*)) 43 *(.init_array) 44 __init_array_end = .; 45 . = ALIGN(16); 46 __CTOR_LIST__ = .; 47 *(SORT(.ctors.*)) 48 *(.ctors) 49 __CTOR_END__ = .; 50 . = ALIGN(16); 51 __DTOR_LIST__ = .; 52 *(SORT(.dtors.*)) 53 *(.dtors) 54 __DTOR_END__ = .; 55 . = ALIGN(16); 56 __fini_array_start = .; 57 *(SORT(.fini_array.*)) 58 *(.fini_array) 59 __fini_array_end = .; 60 61 /* the EFI loader doesn't seem to like a .bss section, so we stick 62 it all into .data: */ 63 *(.dynbss) 64 *(.bss*) 65 *(COMMON) 66 } 67 .note.gnu.build-id : { *(.note.gnu.build-id) } 68 69 . = ALIGN(4096); 70 .dynamic : { *(.dynamic) } 71 . = ALIGN(4096); 72 .rel : 73 { 74 *(.rel.text*) 75 *(.rel.data*) 76 *(.rel.got) 77 *(.rel.dyn) 78 *(.rel.stab) 79 *(.rel.init_array*) 80 *(.rel.fini_array*) 81 *(.rel.ctors*) 82 *(.rel.dtors*) 83 *(.data.rel.ro.local) 84 *(.data.rel.local) 85 *(.data.rel.ro) 86 *(.data.rel*) 87 } 88 . = ALIGN(4096); 89 .rel.plt : { *(.rel.plt) } 90 . = ALIGN(4096); 91 .rodata : { *(.rodata*) } 92 _edata = .; 93 _data_size = _edata - _etext; 94 . = ALIGN(4096); 95 .reloc : /* This is the PECOFF .reloc section! */ 96 { 97 KEEP (*(.reloc)) 98 } 99 . = ALIGN(4096); 100 .dynsym : { *(.dynsym) } 101 . = ALIGN(4096); 102 .dynstr : { *(.dynstr) } 103 . = ALIGN(4096); 104 . = DATA_SEGMENT_END (.); 105 /DISCARD/ : 106 { 107 *(.rel.reloc) 108 *(.note.GNU-stack) 109 } 110 .comment 0 : { *(.comment) } 111} 112