| 1 | /* |
|---|
| 2 | * Linker script for COM16 binaries |
|---|
| 3 | */ |
|---|
| 4 | |
|---|
| 5 | /* Script for -z combreloc: combine and sort reloc sections */ |
|---|
| 6 | OUTPUT_FORMAT("elf32-i386", "elf32-i386", |
|---|
| 7 | "elf32-i386") |
|---|
| 8 | OUTPUT_ARCH(i386) |
|---|
| 9 | EXTERN(_start) |
|---|
| 10 | ENTRY(_start) |
|---|
| 11 | SECTIONS |
|---|
| 12 | { |
|---|
| 13 | /* Read-only sections, merged into text segment: */ |
|---|
| 14 | . = 0x100; |
|---|
| 15 | PROVIDE (__executable_start = .); |
|---|
| 16 | |
|---|
| 17 | .init : |
|---|
| 18 | { |
|---|
| 19 | KEEP (*(.init)) |
|---|
| 20 | } =0x90909090 |
|---|
| 21 | .text : |
|---|
| 22 | { |
|---|
| 23 | *(.text .stub .text.* .gnu.linkonce.t.*) |
|---|
| 24 | /* .gnu.warning sections are handled specially by elf32.em. */ |
|---|
| 25 | *(.gnu.warning) |
|---|
| 26 | } =0x90909090 |
|---|
| 27 | .fini : |
|---|
| 28 | { |
|---|
| 29 | KEEP (*(.fini)) |
|---|
| 30 | } =0x90909090 |
|---|
| 31 | PROVIDE (__etext = .); |
|---|
| 32 | PROVIDE (_etext = .); |
|---|
| 33 | PROVIDE (etext = .); |
|---|
| 34 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } |
|---|
| 35 | .rodata1 : { *(.rodata1) } |
|---|
| 36 | |
|---|
| 37 | /* Ensure the __preinit_array_start label is properly aligned. We |
|---|
| 38 | could instead move the label definition inside the section, but |
|---|
| 39 | the linker would then create the section even if it turns out to |
|---|
| 40 | be empty, which isn't pretty. */ |
|---|
| 41 | . = ALIGN(4); |
|---|
| 42 | PROVIDE (__preinit_array_start = .); |
|---|
| 43 | .preinit_array : { *(.preinit_array) } |
|---|
| 44 | PROVIDE (__preinit_array_end = .); |
|---|
| 45 | PROVIDE (__init_array_start = .); |
|---|
| 46 | .init_array : { *(.init_array) } |
|---|
| 47 | PROVIDE (__init_array_end = .); |
|---|
| 48 | PROVIDE (__fini_array_start = .); |
|---|
| 49 | .fini_array : { *(.fini_array) } |
|---|
| 50 | PROVIDE (__fini_array_end = .); |
|---|
| 51 | PROVIDE (__ctors_start = .); |
|---|
| 52 | .ctors : |
|---|
| 53 | { |
|---|
| 54 | KEEP (*(SORT(.ctors.*))) |
|---|
| 55 | KEEP (*(.ctors)) |
|---|
| 56 | } |
|---|
| 57 | PROVIDE (__ctors_end = .); |
|---|
| 58 | PROVIDE (__dtors_start = .); |
|---|
| 59 | .dtors : |
|---|
| 60 | { |
|---|
| 61 | KEEP (*(SORT(.dtors.*))) |
|---|
| 62 | KEEP (*(.dtors)) |
|---|
| 63 | } |
|---|
| 64 | PROVIDE (__dtors_end = .); |
|---|
| 65 | |
|---|
| 66 | /* Adjust the address for the data segment. Avoid mixing code and |
|---|
| 67 | data within same 128-byte chunk. */ |
|---|
| 68 | . = ALIGN(128); |
|---|
| 69 | |
|---|
| 70 | .data : |
|---|
| 71 | { |
|---|
| 72 | *(.data .data.* .gnu.linkonce.d.*) |
|---|
| 73 | SORT(CONSTRUCTORS) |
|---|
| 74 | } |
|---|
| 75 | .data1 : { *(.data1) } |
|---|
| 76 | _edata = .; |
|---|
| 77 | PROVIDE (edata = .); |
|---|
| 78 | __bss_start = .; |
|---|
| 79 | .bss : |
|---|
| 80 | { |
|---|
| 81 | *(.dynbss) |
|---|
| 82 | *(.bss .bss.* .gnu.linkonce.b.*) |
|---|
| 83 | *(COMMON) |
|---|
| 84 | /* Align here to ensure that the .bss section occupies space up to |
|---|
| 85 | _end. Align after .bss to ensure correct alignment even if the |
|---|
| 86 | .bss section disappears because there are no input sections. */ |
|---|
| 87 | . = ALIGN(32 / 8); |
|---|
| 88 | } |
|---|
| 89 | . = ALIGN(32 / 8); |
|---|
| 90 | _end = .; |
|---|
| 91 | PROVIDE (end = .); |
|---|
| 92 | |
|---|
| 93 | /* Stabs debugging sections. */ |
|---|
| 94 | .stab 0 : { *(.stab) } |
|---|
| 95 | .stabstr 0 : { *(.stabstr) } |
|---|
| 96 | .stab.excl 0 : { *(.stab.excl) } |
|---|
| 97 | .stab.exclstr 0 : { *(.stab.exclstr) } |
|---|
| 98 | .stab.index 0 : { *(.stab.index) } |
|---|
| 99 | .stab.indexstr 0 : { *(.stab.indexstr) } |
|---|
| 100 | .comment 0 : { *(.comment) } |
|---|
| 101 | /* DWARF debug sections. |
|---|
| 102 | Symbols in the DWARF debugging sections are relative to the beginning |
|---|
| 103 | of the section so we begin them at 0. */ |
|---|
| 104 | /* DWARF 1 */ |
|---|
| 105 | .debug 0 : { *(.debug) } |
|---|
| 106 | .line 0 : { *(.line) } |
|---|
| 107 | /* GNU DWARF 1 extensions */ |
|---|
| 108 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
|---|
| 109 | .debug_sfnames 0 : { *(.debug_sfnames) } |
|---|
| 110 | /* DWARF 1.1 and DWARF 2 */ |
|---|
| 111 | .debug_aranges 0 : { *(.debug_aranges) } |
|---|
| 112 | .debug_pubnames 0 : { *(.debug_pubnames) } |
|---|
| 113 | /* DWARF 2 */ |
|---|
| 114 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
|---|
| 115 | .debug_abbrev 0 : { *(.debug_abbrev) } |
|---|
| 116 | .debug_line 0 : { *(.debug_line) } |
|---|
| 117 | .debug_frame 0 : { *(.debug_frame) } |
|---|
| 118 | .debug_str 0 : { *(.debug_str) } |
|---|
| 119 | .debug_loc 0 : { *(.debug_loc) } |
|---|
| 120 | .debug_macinfo 0 : { *(.debug_macinfo) } |
|---|
| 121 | /* SGI/MIPS DWARF 2 extensions */ |
|---|
| 122 | .debug_weaknames 0 : { *(.debug_weaknames) } |
|---|
| 123 | .debug_funcnames 0 : { *(.debug_funcnames) } |
|---|
| 124 | .debug_typenames 0 : { *(.debug_typenames) } |
|---|
| 125 | .debug_varnames 0 : { *(.debug_varnames) } |
|---|
| 126 | /DISCARD/ : { *(.note.GNU-stack) } |
|---|
| 127 | } |
|---|