Re: [cc65] mirror code in linker scripts

From: Ullrich von Bassewitz <>
Date: 2013-05-05 15:05:13

On Wed, May 01, 2013 at 07:06:12PM +0200, Sven Oliver Moll wrote:
> It works, but has some redundancy in it this will make things very
> complicated when going for 4 or 8 banks. Let me use "VECTORS0" and
> "VECTORS1" as an example of my problems. These contain the reset and
> irq vectors and should be the same on every bank. Right now I need
> to specify the same vectors for every bank, but I just want to load
> them from the same segment "VECTORS" to every bank. Any way I tried,
> somewhere on the road it
> got a "defined twice"-error.

You cannot place one segment into more than one memory area in one linker run.
But there are workarounds: You can for example compile one source file (the
one containing the vectors) into several object files, containing the same
stuff. Beware however, the file must not contain labels otherwise you will get
duplicate symbol errors.

> And I've got another problem, this time concerning the RAM segment.
> I need two different RAM segments: one that can be shared amount all
> source code, as it is now, but I also need a second one for
> temporary data, that will be reset when the source file changes. Any
> ideas on how to accompish that?

You might try using separate RAM segments but place them at the same address.



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun May 5 15:05:19 2013

This archive was generated by hypermail 2.1.8 : 2013-06-15 17:37:38 CEST