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