Daniel Stenberg | 0a0c4d5 | 2005-02-04 08:34:20 +0000 | [diff] [blame] | 1 | #include "config.h" |
2 | |||||
3 | /* These output formats should be in the config-files */ | ||||
4 | |||||
Christian Gmeiner | c6ff1f5 | 2005-07-18 12:40:29 +0000 | [diff] [blame] | 5 | #ifdef CPU_COLDFIRE |
Daniel Stenberg | 0a0c4d5 | 2005-02-04 08:34:20 +0000 | [diff] [blame] | 6 | OUTPUT_FORMAT(elf32-m68k) |
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 7 | #elif defined(CPU_ARM) |
Dave Chapman | afbd438 | 2005-11-12 16:01:15 +0000 | [diff] [blame] | 8 | OUTPUT_FORMAT(elf32-littlearm) |
Daniel Stenberg | 0a0c4d5 | 2005-02-04 08:34:20 +0000 | [diff] [blame] | 9 | #else |
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 10 | OUTPUT_FORMAT(elf32-sh) |
Daniel Stenberg | 0a0c4d5 | 2005-02-04 08:34:20 +0000 | [diff] [blame] | 11 | #endif |
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 12 | |
Daniel Stenberg | bc54fbd | 2005-02-04 12:25:18 +0000 | [diff] [blame] | 13 | #ifdef DEBUG |
14 | #define STUBOFFSET 0x10000 | ||||
15 | #else | ||||
16 | #define STUBOFFSET 0 | ||||
17 | #endif | ||||
18 | |||||
Linus Nielsen Feltzing | 2d25122 | 2005-07-08 15:08:59 +0000 | [diff] [blame] | 19 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300) |
Daniel Stenberg | 3a78ab9 | 2005-06-29 13:12:45 +0000 | [diff] [blame] | 20 | #define ARCH_IRIVER |
21 | #endif | ||||
22 | |||||
Dave Chapman | d350e80 | 2006-02-05 19:27:23 +0000 | [diff] [blame] | 23 | #if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) |
Dave Chapman | afbd438 | 2005-11-12 16:01:15 +0000 | [diff] [blame] | 24 | #define ARCH_IPOD |
25 | #endif | ||||
26 | |||||
Linus Nielsen Feltzing | 62c768c | 2005-07-09 07:46:42 +0000 | [diff] [blame] | 27 | #ifdef ARCH_IRIVER |
Linus Nielsen Feltzing | c88b5b7 | 2005-04-20 18:54:20 +0000 | [diff] [blame] | 28 | #define DRAMORIG 0x31000000 |
Jens Arnold | a317d74 | 2005-09-01 20:57:33 +0000 | [diff] [blame] | 29 | #define IRAMORIG 0x1000c000 |
30 | #define IRAMSIZE 0xc000 | ||||
Dave Chapman | afbd438 | 2005-11-12 16:01:15 +0000 | [diff] [blame] | 31 | #elif defined(ARCH_IPOD) |
Dave Chapman | d6d5da1 | 2006-01-16 12:57:46 +0000 | [diff] [blame] | 32 | #define DRAMORIG 0x00000000 |
Dave Chapman | afbd438 | 2005-11-12 16:01:15 +0000 | [diff] [blame] | 33 | #define IRAMORIG 0x4000c000 |
34 | #define IRAMSIZE 0xc000 | ||||
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 35 | #elif CONFIG_CPU == PNX0101 |
Tomasz Malesinski | e7f7c3d | 2006-02-12 23:16:05 +0000 | [diff] [blame^] | 36 | #define DRAMORIG 0xc00000 + STUBOFFSET |
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 37 | #define IRAMORIG 0x408000 |
38 | #define IRAMSIZE 0x8000 | ||||
Daniel Stenberg | bc54fbd | 2005-02-04 12:25:18 +0000 | [diff] [blame] | 39 | #else |
40 | #define DRAMORIG 0x09000000 + STUBOFFSET | ||||
41 | #endif | ||||
42 | |||||
Daniel Stenberg | a24017f4 | 2005-06-27 21:23:03 +0000 | [diff] [blame] | 43 | #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE |
Jens Arnold | 91f572c | 2005-06-28 21:12:11 +0000 | [diff] [blame] | 44 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - CODEC_SIZE |
45 | #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE)) | ||||
46 | #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE) | ||||
47 | |||||
Daniel Stenberg | a24017f4 | 2005-06-27 21:23:03 +0000 | [diff] [blame] | 48 | |
Linus Nielsen Feltzing | ecf2f747 | 2005-06-22 02:47:54 +0000 | [diff] [blame] | 49 | #ifdef CODEC |
Linus Nielsen Feltzing | ecf2f747 | 2005-06-22 02:47:54 +0000 | [diff] [blame] | 50 | #define THIS_LENGTH CODEC_SIZE |
Jens Arnold | 91f572c | 2005-06-28 21:12:11 +0000 | [diff] [blame] | 51 | #define THIS_ORIGIN CODEC_ORIGIN |
Linus Nielsen Feltzing | ecf2f747 | 2005-06-22 02:47:54 +0000 | [diff] [blame] | 52 | #else |
53 | #define THIS_LENGTH PLUGIN_LENGTH | ||||
Jens Arnold | 91f572c | 2005-06-28 21:12:11 +0000 | [diff] [blame] | 54 | #define THIS_ORIGIN PLUGIN_ORIGIN |
Linus Nielsen Feltzing | ecf2f747 | 2005-06-22 02:47:54 +0000 | [diff] [blame] | 55 | #endif |
56 | |||||
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 57 | MEMORY |
58 | { | ||||
Jens Arnold | 91f572c | 2005-06-28 21:12:11 +0000 | [diff] [blame] | 59 | PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH |
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 60 | #if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101) |
Linus Nielsen Feltzing | e638ead | 2005-02-22 00:42:22 +0000 | [diff] [blame] | 61 | PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE |
62 | #endif | ||||
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 63 | } |
64 | |||||
65 | SECTIONS | ||||
66 | { | ||||
Jens Arnold | a36b1d4 | 2006-01-15 18:20:18 +0000 | [diff] [blame] | 67 | .header : { |
68 | _plugin_start_addr = .; | ||||
69 | plugin_start_addr = .; | ||||
70 | KEEP(*(.header)) | ||||
71 | } > PLUGIN_RAM | ||||
72 | |||||
73 | .text : | ||||
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 74 | { |
Jens Arnold | 305a7ce | 2005-06-29 21:04:22 +0000 | [diff] [blame] | 75 | *(.text*) |
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 76 | #if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101) |
Dave Chapman | afbd438 | 2005-11-12 16:01:15 +0000 | [diff] [blame] | 77 | *(.glue_7) |
78 | *(.glue_7t) | ||||
79 | #endif | ||||
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 80 | } > PLUGIN_RAM |
81 | |||||
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 82 | .rodata : |
83 | { | ||||
Jens Arnold | 305a7ce | 2005-06-29 21:04:22 +0000 | [diff] [blame] | 84 | *(.rodata*) |
Jörg Hohensohn | 5d761f7 | 2003-08-04 19:13:42 +0000 | [diff] [blame] | 85 | . = ALIGN(0x4); |
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 86 | } > PLUGIN_RAM |
87 | |||||
Jens Arnold | a36b1d4 | 2006-01-15 18:20:18 +0000 | [diff] [blame] | 88 | .data : |
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 89 | { |
90 | *(.data*) | ||||
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 91 | #if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101) |
Linus Nielsen Feltzing | e638ead | 2005-02-22 00:42:22 +0000 | [diff] [blame] | 92 | iramcopy = .; |
93 | #endif | ||||
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 94 | } > PLUGIN_RAM |
Linus Nielsen Feltzing | e638ead | 2005-02-22 00:42:22 +0000 | [diff] [blame] | 95 | |
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 96 | /DISCARD/ : |
97 | { | ||||
98 | *(.eh_frame) | ||||
99 | } | ||||
100 | |||||
Dave Chapman | d83e929 | 2006-01-12 00:35:50 +0000 | [diff] [blame] | 101 | #if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101) |
Linus Nielsen Feltzing | e638ead | 2005-02-22 00:42:22 +0000 | [diff] [blame] | 102 | .iram IRAMORIG : AT ( iramcopy) |
103 | { | ||||
104 | iramstart = .; | ||||
105 | *(.icode) | ||||
Jens Arnold | abd9f83 | 2005-10-19 19:35:24 +0000 | [diff] [blame] | 106 | *(.irodata) |
Linus Nielsen Feltzing | e638ead | 2005-02-22 00:42:22 +0000 | [diff] [blame] | 107 | *(.idata) |
108 | iramend = .; | ||||
109 | } > PLUGIN_IRAM | ||||
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 110 | |
111 | .ibss (NOLOAD) : | ||||
112 | { | ||||
113 | iedata = .; | ||||
114 | *(.ibss) | ||||
115 | . = ALIGN(0x4); | ||||
116 | iend = .; | ||||
117 | } > PLUGIN_IRAM | ||||
118 | |||||
119 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram): | ||||
120 | #else | ||||
121 | .bss : | ||||
Linus Nielsen Feltzing | e638ead | 2005-02-22 00:42:22 +0000 | [diff] [blame] | 122 | #endif |
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 123 | { |
124 | *(.bss*) | ||||
Jens Arnold | a991de3 | 2006-01-08 23:45:29 +0000 | [diff] [blame] | 125 | *(COMMON) |
Jens Arnold | a36b1d4 | 2006-01-15 18:20:18 +0000 | [diff] [blame] | 126 | . = ALIGN(0x4); |
127 | _plugin_end_addr = .; | ||||
128 | plugin_end_addr = .; | ||||
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 129 | } > PLUGIN_RAM |
130 | |||||
Jens Arnold | 305a7ce | 2005-06-29 21:04:22 +0000 | [diff] [blame] | 131 | /* Special trick to avoid a linker error when no other sections are |
132 | left after garbage collection (plugin not for this platform) */ | ||||
Jens Arnold | 07c4254 | 2006-01-08 22:50:14 +0000 | [diff] [blame] | 133 | .comment 0 : |
134 | { | ||||
Jens Arnold | 305a7ce | 2005-06-29 21:04:22 +0000 | [diff] [blame] | 135 | KEEP(*(.comment)) |
136 | } | ||||
Björn Stenberg | ba371fb | 2003-06-29 16:33:04 +0000 | [diff] [blame] | 137 | } |