Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | # Linker script for ARM COFF. |
2 | # Based on i386coff.sc by Ian Taylor <ian@cygnus.com>. | |
985743c7 | 3 | # |
b90efa5b | 4 | # Copyright (C) 2014-2015 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 | if test -z "${DATA_ADDR}"; then | |
12 | if test "$LD_FLAG" = "N" || test "$LD_FLAG" = "n"; then | |
13 | DATA_ADDR=. | |
14 | fi | |
15 | fi | |
fd521b47 NC |
16 | |
17 | # These are substituted in as variables in order to get '}' in a shell | |
18 | # conditional expansion. | |
19 | CTOR='.ctor : { | |
20 | *(SORT(.ctors.*)) | |
21 | *(.ctor) | |
22 | }' | |
23 | DTOR='.dtor : { | |
24 | *(SORT(.dtors.*)) | |
25 | *(.dtor) | |
26 | }' | |
9396a3ce | 27 | |
252b5132 | 28 | cat <<EOF |
b90efa5b | 29 | /* Copyright (C) 2014-2015 Free Software Foundation, Inc. |
985743c7 NC |
30 | |
31 | Copying and distribution of this script, with or without modification, | |
32 | are permitted in any medium without royalty provided the copyright | |
33 | notice and this notice are preserved. */ | |
34 | ||
6da0974a | 35 | OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", "${LITTLE_OUTPUT_FORMAT}") |
252b5132 RH |
36 | ${LIB_SEARCH_DIRS} |
37 | ||
596d6d91 | 38 | ${RELOCATING+ENTRY (${ENTRY})} |
252b5132 RH |
39 | |
40 | SECTIONS | |
41 | { | |
42 | /* We start at 0x8000 because gdb assumes it (see FRAME_CHAIN). | |
43 | This is an artifact of the ARM Demon monitor using the bottom 32k | |
44 | as workspace (shared with the FP instruction emulator if | |
45 | present): */ | |
46 | .text ${RELOCATING+ 0x8000} : { | |
47 | *(.init) | |
87748b32 | 48 | *(.text*) |
252b5132 RH |
49 | *(.glue_7t) |
50 | *(.glue_7) | |
51 | *(.rdata) | |
52 | ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; | |
53 | LONG (-1); *(.ctors); *(.ctor); LONG (0); } | |
54 | ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; | |
55 | LONG (-1); *(.dtors); *(.dtor); LONG (0); } | |
56 | *(.fini) | |
57 | ${RELOCATING+ etext = .;} | |
87748b32 | 58 | ${RELOCATING+ _etext = .;} |
252b5132 | 59 | } |
e16bb312 | 60 | .data ${RELOCATING+${DATA_ADDR-0x40000 + (ALIGN(0x8) & 0xfffc0fff)}} : { |
252b5132 | 61 | ${RELOCATING+ __data_start__ = . ;} |
87748b32 | 62 | *(.data*) |
fd521b47 NC |
63 | |
64 | ${RELOCATING+*(.gcc_exc*)} | |
65 | ${RELOCATING+___EH_FRAME_BEGIN__ = . ;} | |
66 | ${RELOCATING+*(.eh_fram*)} | |
67 | ${RELOCATING+___EH_FRAME_END__ = . ;} | |
68 | ${RELOCATING+LONG(0);} | |
69 | ||
252b5132 RH |
70 | ${RELOCATING+ __data_end__ = . ;} |
71 | ${RELOCATING+ edata = .;} | |
72 | ${RELOCATING+ _edata = .;} | |
73 | } | |
fd521b47 NC |
74 | ${CONSTRUCTING+${RELOCATING-$CTOR}} |
75 | ${CONSTRUCTING+${RELOCATING-$DTOR}} | |
e16bb312 | 76 | .bss ${RELOCATING+ ALIGN(0x8)} : |
252b5132 RH |
77 | { |
78 | ${RELOCATING+ __bss_start__ = . ;} | |
79 | *(.bss) | |
80 | *(COMMON) | |
81 | ${RELOCATING+ __bss_end__ = . ;} | |
82 | } | |
83 | ||
84 | ${RELOCATING+ end = .;} | |
85 | ${RELOCATING+ _end = .;} | |
86 | ${RELOCATING+ __end__ = .;} | |
87 | ||
88 | .stab 0 ${RELOCATING+(NOLOAD)} : | |
89 | { | |
90 | [ .stab ] | |
91 | } | |
92 | .stabstr 0 ${RELOCATING+(NOLOAD)} : | |
93 | { | |
94 | [ .stabstr ] | |
95 | } | |
96 | } | |
97 | EOF |