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