Re: [cc65] Overlaying segments?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-11-10 16:20:28
On Tue, Nov 10, 2009 at 07:15:53AM -0800, Fatih Aygün wrote:
> I have 8 segments: the usual "code", "rodata", "data" ,"bss" plus "init_code",
> "init_rodata", "init_data", "init_bss". The init_* segments are supposed to do
> some lengthy initialization and then they are not needed anymore. I want them
> overlaid with the "bss" segment to save memory, but I don't know its address,
> because it's where the "code" + "rodata" + "data" ends and I don't know their
> sizes.
>
> Is it currently achievable with ld65?

Just add "define = yes" to the BSS segment in the linker config, and the
linker will export the symbols __BSS_RUN__, __BSS_LOAD__ and __BSS_SIZE__.

This is true for every other segment as well. If you need the size of the CODE
segment, add "define = yes", and the linker will export __CODE_SIZE__ plus the
others.

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 Nov 10 16:20:36 2009

This archive was generated by hypermail 2.1.8 : 2009-11-10 16:20:38 CET