Commit | Line | Data |
---|---|---|
252b5132 | 1 | # Linker script for i386 go32 (DJGPP) |
985743c7 | 2 | # |
b3adc24a | 3 | # Copyright (C) 2014-2020 Free Software Foundation, Inc. |
6c19b93b | 4 | # |
985743c7 NC |
5 | # Copying and distribution of this file, with or without modification, |
6 | # are permitted in any medium without royalty provided the copyright | |
7 | # notice and this notice are preserved. | |
252b5132 RH |
8 | |
9 | test -z "$ENTRY" && ENTRY=start | |
10 | EXE=${CONSTRUCTING+${RELOCATING+-exe}} | |
11 | ||
12 | # These are substituted in as variables in order to get '}' in a shell | |
13 | # conditional expansion. | |
062739d1 NC |
14 | CTOR='.ctor : { |
15 | *(SORT(.ctors.*)) | |
16 | *(.ctor) | |
17 | }' | |
18 | DTOR='.dtor : { | |
19 | *(SORT(.dtors.*)) | |
20 | *(.dtor) | |
21 | }' | |
252b5132 RH |
22 | |
23 | cat <<EOF | |
b3adc24a | 24 | /* Copyright (C) 2014-2020 Free Software Foundation, Inc. |
985743c7 NC |
25 | |
26 | Copying and distribution of this script, with or without modification, | |
27 | are permitted in any medium without royalty provided the copyright | |
28 | notice and this notice are preserved. */ | |
29 | ||
252b5132 RH |
30 | OUTPUT_FORMAT("${OUTPUT_FORMAT}${EXE}") |
31 | ||
596d6d91 | 32 | ${RELOCATING+ENTRY (${ENTRY})} |
252b5132 RH |
33 | |
34 | SECTIONS | |
35 | { | |
36 | .text ${RELOCATING+ ${TARGET_PAGE_SIZE}+SIZEOF_HEADERS} : { | |
37 | *(.text) | |
c20ec07b | 38 | ${RELOCATING+*(.text.*)} |
5a1bd109 | 39 | ${RELOCATING+*(.gnu.linkonce.t*)} |
252b5132 RH |
40 | *(.const*) |
41 | *(.ro*) | |
5a1bd109 | 42 | ${RELOCATING+*(.gnu.linkonce.r*)} |
93b63cd3 | 43 | ${RELOCATING+etext = . ; PROVIDE(_etext = .) ;} |
252b5132 RH |
44 | ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});} |
45 | } | |
0fe0f2d6 | 46 | |
252b5132 RH |
47 | .data ${RELOCATING+ ${DATA_ALIGNMENT}} : { |
48 | ${RELOCATING+djgpp_first_ctor = . ; | |
062739d1 | 49 | *(SORT(.ctors.*)) |
252b5132 | 50 | *(.ctor) |
0fe0f2d6 | 51 | *(.ctors) |
252b5132 RH |
52 | djgpp_last_ctor = . ;} |
53 | ${RELOCATING+djgpp_first_dtor = . ; | |
062739d1 | 54 | *(SORT(.dtors.*)) |
252b5132 | 55 | *(.dtor) |
0fe0f2d6 | 56 | *(.dtors) |
252b5132 | 57 | djgpp_last_dtor = . ;} |
0fe0f2d6 JMG |
58 | __environ = . ; |
59 | PROVIDE(_environ = .) ; | |
60 | LONG(0) ; | |
252b5132 | 61 | *(.data) |
c20ec07b | 62 | ${RELOCATING+*(.data.*)} |
9c9ef45f ILT |
63 | |
64 | ${RELOCATING+*(.gcc_exc*)} | |
65 | ${RELOCATING+___EH_FRAME_BEGIN__ = . ;} | |
66 | ${RELOCATING+*(.eh_fram*)} | |
67 | ${RELOCATING+___EH_FRAME_END__ = . ;} | |
68 | ${RELOCATING+LONG(0);} | |
69 | ||
5a1bd109 | 70 | ${RELOCATING+*(.gnu.linkonce.d*)} |
93b63cd3 | 71 | ${RELOCATING+edata = . ; PROVIDE(_edata = .) ;} |
5a1bd109 | 72 | ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});} |
252b5132 | 73 | } |
0fe0f2d6 | 74 | |
252b5132 RH |
75 | ${CONSTRUCTING+${RELOCATING-$CTOR}} |
76 | ${CONSTRUCTING+${RELOCATING-$DTOR}} | |
0fe0f2d6 | 77 | |
252b5132 | 78 | .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : |
6c19b93b | 79 | { |
8e616ecc | 80 | *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) |
252b5132 | 81 | *(COMMON) |
93b63cd3 | 82 | ${RELOCATING+ end = . ; PROVIDE(_end = .) ;} |
252b5132 RH |
83 | ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});} |
84 | } | |
0fe0f2d6 JMG |
85 | |
86 | /* Discard LTO sections. */ | |
87 | /DISCARD/ : { *(.gnu.lto_*) } | |
88 | ||
c20ec07b NC |
89 | /* Stabs debugging sections. */ |
90 | .stab 0 : { *(.stab) } | |
91 | .stabstr 0 : { *(.stabstr) } | |
ceb0a680 | 92 | EOF |
2a995fc1 | 93 | |
d061dfac | 94 | . $srcdir/scripttempl/DWARF.sc |
2a995fc1 | 95 | |
ceb0a680 | 96 | cat <<EOF |
252b5132 RH |
97 | } |
98 | EOF |