Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # Linker script for 386 COFF. This works on SVR3.2 and SCO Unix 3.2.2. |
2 | # Ian Taylor <ian@cygnus.com>. | |
985743c7 | 3 | # |
6f2750fe | 4 | # Copyright (C) 2014-2016 Free Software Foundation, Inc. |
985743c7 NC |
5 | # |
6 | # Copying and distribution of this file, with or without modification, | |
7 | # are permitted in any medium without royalty provided the copyright | |
8 | # notice and this notice are preserved. | |
9 | ||
252b5132 RH |
10 | test -z "$ENTRY" && ENTRY=_start |
11 | # These are substituted in as variables in order to get '}' in a shell | |
12 | # conditional expansion. | |
13 | INIT='.init : { *(.init) }' | |
14 | FINI='.fini : { *(.fini) }' | |
985743c7 | 15 | |
252b5132 | 16 | cat <<EOF |
6f2750fe | 17 | /* Copyright (C) 2014-2016 Free Software Foundation, Inc. |
985743c7 NC |
18 | |
19 | Copying and distribution of this script, with or without modification, | |
20 | are permitted in any medium without royalty provided the copyright | |
21 | notice and this notice are preserved. */ | |
22 | ||
252b5132 RH |
23 | OUTPUT_FORMAT("${OUTPUT_FORMAT}") |
24 | ${LIB_SEARCH_DIRS} | |
25 | ||
596d6d91 | 26 | ${RELOCATING+ENTRY (${ENTRY})} |
252b5132 RH |
27 | |
28 | SECTIONS | |
29 | { | |
30 | .text ${RELOCATING+ SIZEOF_HEADERS} : { | |
31 | ${RELOCATING+ *(.init)} | |
32 | *(.text) | |
33 | ${RELOCATING+ *(.fini)} | |
34 | ${RELOCATING+ etext = .}; | |
35 | } | |
36 | .data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : { | |
37 | *(.data) | |
38 | ${RELOCATING+ edata = .}; | |
39 | } | |
40 | .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : | |
41 | { | |
42 | *(.bss) | |
43 | *(COMMON) | |
44 | ${RELOCATING+ end = .}; | |
45 | } | |
46 | ${RELOCATING- ${INIT}} | |
47 | ${RELOCATING- ${FINI}} | |
48 | .stab 0 ${RELOCATING+(NOLOAD)} : | |
49 | { | |
50 | [ .stab ] | |
51 | } | |
52 | .stabstr 0 ${RELOCATING+(NOLOAD)} : | |
53 | { | |
54 | [ .stabstr ] | |
55 | } | |
56 | } | |
57 | EOF |