Re: [cc65] drive code with shared segments

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-04-19 15:00:15
On Tue, Apr 19, 2005 at 02:38:53PM +0200, MagerValp wrote:
> How do I get 4 overlapping SPECIFIC segments?

Ok, I think I understand the problem now. You want one file with the shared
and the four specific segments, but each one of the specific segments should
be relocated to the same start address.

There is no easy solution for the problem. If you could live with generating
more than one output file and concatenating them together, you could generate
four binary files by running the linker four times:

# Linker config for shared + specific1
MEMORY {
  RAM: start = $0500, size = $0300, file = "file1.bin";
}
SEGMENTS {
    SHARED:     load = RAM, type = ro;
    SPECIFIC1:  load = RAM, type = ro;
}

# Linker config for specific2
MEMORY {
  RAM: start = $0500, size = $0300, file = "file2.bin";
}
SEGMENTS {
    SHARED:     load = RAM, type = bss;
    SPECIFIC2:  load = RAM, type = ro;
}

...

Later: cat file1.bin file2.bin file3.bin file4.bin > file.bin

Declaring the SHARED segment as type bss will discard the data but increase
the program counter. It will give warnings about "bss segment contains
initialized data", but you can ignore these warnings (or filter them out).

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Apr 19 15:00:25 2005

This archive was generated by hypermail 2.1.8 : 2005-04-19 15:00:27 CEST