blob: f9c2406893eee60d04c294ad539ebfe46aa6b617 [file] [log] [blame]
Daniel Stenberg0a0c4d52005-02-04 08:34:20 +00001#include "config.h"
2
3/* These output formats should be in the config-files */
4
Christian Gmeinerc6ff1f52005-07-18 12:40:29 +00005#ifdef CPU_COLDFIRE
Daniel Stenberg0a0c4d52005-02-04 08:34:20 +00006OUTPUT_FORMAT(elf32-m68k)
Dave Chapmand83e9292006-01-12 00:35:50 +00007#elif defined(CPU_ARM)
Dave Chapmanafbd4382005-11-12 16:01:15 +00008OUTPUT_FORMAT(elf32-littlearm)
Daniel Stenberg0a0c4d52005-02-04 08:34:20 +00009#else
Björn Stenbergba371fb2003-06-29 16:33:04 +000010OUTPUT_FORMAT(elf32-sh)
Daniel Stenberg0a0c4d52005-02-04 08:34:20 +000011#endif
Björn Stenbergba371fb2003-06-29 16:33:04 +000012
Daniel Stenbergbc54fbd2005-02-04 12:25:18 +000013#ifdef DEBUG
14#define STUBOFFSET 0x10000
15#else
16#define STUBOFFSET 0
17#endif
18
Linus Nielsen Feltzing2d251222005-07-08 15:08:59 +000019#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
Daniel Stenberg3a78ab92005-06-29 13:12:45 +000020#define ARCH_IRIVER
21#endif
22
Dave Chapmand350e802006-02-05 19:27:23 +000023#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020)
Dave Chapmanafbd4382005-11-12 16:01:15 +000024#define ARCH_IPOD
25#endif
26
Linus Nielsen Feltzing62c768c2005-07-09 07:46:42 +000027#ifdef ARCH_IRIVER
Linus Nielsen Feltzingc88b5b72005-04-20 18:54:20 +000028#define DRAMORIG 0x31000000
Jens Arnolda317d742005-09-01 20:57:33 +000029#define IRAMORIG 0x1000c000
30#define IRAMSIZE 0xc000
Dave Chapmanafbd4382005-11-12 16:01:15 +000031#elif defined(ARCH_IPOD)
Dave Chapmand6d5da12006-01-16 12:57:46 +000032#define DRAMORIG 0x00000000
Dave Chapmanafbd4382005-11-12 16:01:15 +000033#define IRAMORIG 0x4000c000
34#define IRAMSIZE 0xc000
Dave Chapmand83e9292006-01-12 00:35:50 +000035#elif CONFIG_CPU == PNX0101
Tomasz Malesinskie7f7c3d2006-02-12 23:16:05 +000036#define DRAMORIG 0xc00000 + STUBOFFSET
Dave Chapmand83e9292006-01-12 00:35:50 +000037#define IRAMORIG 0x408000
38#define IRAMSIZE 0x8000
Daniel Stenbergbc54fbd2005-02-04 12:25:18 +000039#else
40#define DRAMORIG 0x09000000 + STUBOFFSET
41#endif
42
Daniel Stenberga24017f42005-06-27 21:23:03 +000043#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
Jens Arnold91f572c2005-06-28 21:12:11 +000044#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - CODEC_SIZE
45#define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
46#define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
47
Daniel Stenberga24017f42005-06-27 21:23:03 +000048
Linus Nielsen Feltzingecf2f7472005-06-22 02:47:54 +000049#ifdef CODEC
Linus Nielsen Feltzingecf2f7472005-06-22 02:47:54 +000050#define THIS_LENGTH CODEC_SIZE
Jens Arnold91f572c2005-06-28 21:12:11 +000051#define THIS_ORIGIN CODEC_ORIGIN
Linus Nielsen Feltzingecf2f7472005-06-22 02:47:54 +000052#else
53#define THIS_LENGTH PLUGIN_LENGTH
Jens Arnold91f572c2005-06-28 21:12:11 +000054#define THIS_ORIGIN PLUGIN_ORIGIN
Linus Nielsen Feltzingecf2f7472005-06-22 02:47:54 +000055#endif
56
Björn Stenbergba371fb2003-06-29 16:33:04 +000057MEMORY
58{
Jens Arnold91f572c2005-06-28 21:12:11 +000059 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
Dave Chapmand83e9292006-01-12 00:35:50 +000060#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
Linus Nielsen Feltzinge638ead2005-02-22 00:42:22 +000061 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
62#endif
Björn Stenbergba371fb2003-06-29 16:33:04 +000063}
64
65SECTIONS
66{
Jens Arnolda36b1d42006-01-15 18:20:18 +000067 .header : {
68 _plugin_start_addr = .;
69 plugin_start_addr = .;
70 KEEP(*(.header))
71 } > PLUGIN_RAM
72
73 .text :
Jens Arnold07c42542006-01-08 22:50:14 +000074 {
Jens Arnold305a7ce2005-06-29 21:04:22 +000075 *(.text*)
Dave Chapmand83e9292006-01-12 00:35:50 +000076#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
Dave Chapmanafbd4382005-11-12 16:01:15 +000077 *(.glue_7)
78 *(.glue_7t)
79#endif
Björn Stenbergba371fb2003-06-29 16:33:04 +000080 } > PLUGIN_RAM
81
Jens Arnold07c42542006-01-08 22:50:14 +000082 .rodata :
83 {
Jens Arnold305a7ce2005-06-29 21:04:22 +000084 *(.rodata*)
Jörg Hohensohn5d761f72003-08-04 19:13:42 +000085 . = ALIGN(0x4);
Jens Arnold07c42542006-01-08 22:50:14 +000086 } > PLUGIN_RAM
87
Jens Arnolda36b1d42006-01-15 18:20:18 +000088 .data :
Jens Arnold07c42542006-01-08 22:50:14 +000089 {
90 *(.data*)
Dave Chapmand83e9292006-01-12 00:35:50 +000091#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
Linus Nielsen Feltzinge638ead2005-02-22 00:42:22 +000092 iramcopy = .;
93#endif
Björn Stenbergba371fb2003-06-29 16:33:04 +000094 } > PLUGIN_RAM
Linus Nielsen Feltzinge638ead2005-02-22 00:42:22 +000095
Jens Arnold07c42542006-01-08 22:50:14 +000096 /DISCARD/ :
97 {
98 *(.eh_frame)
99 }
100
Dave Chapmand83e9292006-01-12 00:35:50 +0000101#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
Linus Nielsen Feltzinge638ead2005-02-22 00:42:22 +0000102 .iram IRAMORIG : AT ( iramcopy)
103 {
104 iramstart = .;
105 *(.icode)
Jens Arnoldabd9f832005-10-19 19:35:24 +0000106 *(.irodata)
Linus Nielsen Feltzinge638ead2005-02-22 00:42:22 +0000107 *(.idata)
108 iramend = .;
109 } > PLUGIN_IRAM
Jens Arnold07c42542006-01-08 22:50:14 +0000110
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 Feltzinge638ead2005-02-22 00:42:22 +0000122#endif
Jens Arnold07c42542006-01-08 22:50:14 +0000123 {
124 *(.bss*)
Jens Arnolda991de32006-01-08 23:45:29 +0000125 *(COMMON)
Jens Arnolda36b1d42006-01-15 18:20:18 +0000126 . = ALIGN(0x4);
127 _plugin_end_addr = .;
128 plugin_end_addr = .;
Jens Arnold07c42542006-01-08 22:50:14 +0000129 } > PLUGIN_RAM
130
Jens Arnold305a7ce2005-06-29 21:04:22 +0000131 /* Special trick to avoid a linker error when no other sections are
132 left after garbage collection (plugin not for this platform) */
Jens Arnold07c42542006-01-08 22:50:14 +0000133 .comment 0 :
134 {
Jens Arnold305a7ce2005-06-29 21:04:22 +0000135 KEEP(*(.comment))
136 }
Björn Stenbergba371fb2003-06-29 16:33:04 +0000137}