Commit | Line | Data |
---|---|---|
b90efa5b | 1 | # Copyright (C) 2014-2015 Free Software Foundation, Inc. |
985743c7 NC |
2 | # |
3 | # Copying and distribution of this file, with or without modification, | |
4 | # are permitted in any medium without royalty provided the copyright | |
5 | # notice and this notice are preserved. | |
6 | ||
40a633d5 | 7 | TORS=".tors : |
1ce7de8b KH |
8 | { |
9 | ___ctors = . ; | |
10 | *(.ctors) | |
11 | ___ctors_end = . ; | |
12 | ___dtors = . ; | |
13 | *(.dtors) | |
14 | ___dtors_end = . ; | |
15 | } > ram" | |
40a633d5 | 16 | |
252b5132 | 17 | cat <<EOF |
b90efa5b | 18 | /* Copyright (C) 2014-2015 Free Software Foundation, Inc. |
985743c7 NC |
19 | |
20 | Copying and distribution of this script, with or without modification, | |
21 | are permitted in any medium without royalty provided the copyright | |
22 | notice and this notice are preserved. */ | |
23 | ||
252b5132 RH |
24 | OUTPUT_FORMAT("${OUTPUT_FORMAT}") |
25 | OUTPUT_ARCH(${ARCH}) | |
596d6d91 | 26 | ${RELOCATING+ENTRY ("_start")} |
252b5132 RH |
27 | |
28 | MEMORY | |
29 | { | |
30 | /* 0xc4 is a magic entry. We should have the linker just | |
60c6797e | 31 | skip over it one day... */ |
252b5132 RH |
32 | vectors : o = 0x0000, l = 0xc4 |
33 | magicvectors : o = 0xc4, l = 0x3c | |
34 | ram : o = 0x0100, l = 0xfdfc | |
35 | /* The stack starts at the top of main ram. */ | |
36 | topram : o = 0xfefc, l = 0x4 | |
60c6797e | 37 | /* At the very top of the address space is the 8-bit area. */ |
252b5132 RH |
38 | eight : o = 0xff00, l = 0x100 |
39 | } | |
40 | ||
60c6797e KH |
41 | SECTIONS |
42 | { | |
40a633d5 | 43 | .vectors : |
1ce7de8b | 44 | { |
40a633d5 | 45 | /* Use something like this to place a specific |
60c6797e | 46 | function's address into the vector table. |
252b5132 | 47 | |
40a633d5 | 48 | SHORT (ABSOLUTE (_foobar)). */ |
252b5132 | 49 | |
40a633d5 | 50 | *(.vectors) |
1ce7de8b | 51 | } ${RELOCATING+ > vectors} |
252b5132 | 52 | |
8d9cd6b1 NC |
53 | .init : |
54 | { | |
55 | *(.init) | |
56 | } ${RELOCATING+ > ram} | |
57 | ||
40a633d5 | 58 | .text : |
60c6797e KH |
59 | { |
60 | *(.rodata) | |
61 | *(.text) | |
8d9cd6b1 | 62 | *(.text.*) |
40a633d5 NC |
63 | *(.strings) |
64 | ${RELOCATING+ _etext = . ; } | |
252b5132 | 65 | } ${RELOCATING+ > ram} |
60c6797e | 66 | |
1ce7de8b | 67 | ${CONSTRUCTING+${TORS}} |
60c6797e | 68 | |
40a633d5 NC |
69 | .data : |
70 | { | |
71 | *(.data) | |
8d9cd6b1 | 72 | *(.data.*) |
40a633d5 NC |
73 | *(.tiny) |
74 | ${RELOCATING+ _edata = . ; } | |
252b5132 | 75 | } ${RELOCATING+ > ram} |
60c6797e | 76 | |
40a633d5 NC |
77 | .bss : |
78 | { | |
79 | ${RELOCATING+ _bss_start = . ;} | |
80 | *(.bss) | |
81 | *(COMMON) | |
82 | ${RELOCATING+ _end = . ; } | |
252b5132 | 83 | } ${RELOCATING+ >ram} |
60c6797e | 84 | |
40a633d5 NC |
85 | .stack : |
86 | { | |
87 | ${RELOCATING+ _stack = . ; } | |
88 | *(.stack) | |
252b5132 | 89 | } ${RELOCATING+ > topram} |
60c6797e | 90 | |
40a633d5 NC |
91 | .eight : |
92 | { | |
93 | *(.eight) | |
252b5132 | 94 | } ${RELOCATING+ > eight} |
60c6797e | 95 | |
40a633d5 NC |
96 | .stab 0 ${RELOCATING+(NOLOAD)} : |
97 | { | |
98 | [ .stab ] | |
252b5132 | 99 | } |
60c6797e | 100 | |
40a633d5 NC |
101 | .stabstr 0 ${RELOCATING+(NOLOAD)} : |
102 | { | |
103 | [ .stabstr ] | |
252b5132 RH |
104 | } |
105 | } | |
106 | EOF |