Re: [cc65] How to link in most of the C-library

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2006-02-14 20:17:19
Good evening!

On Tue, Feb 14, 2006 at 11:43:39AM +0200, Karri Kaksonen wrote:
> My question is:
> Is it possible to force the entire C-library into my RAM-segment somehow
> so that future EEPROM-based gamed would not need additions to the
> resident RAM-segment?

There's no direct support for it. What you can try: Extract all object files
from the library. Run od65 with the --dump-exports switch on each of the
object files and use a script (perl comes to mind) to extract the names of the
symbols from the output. Let this script generate one big assembler file with
lots of .FORCEIMPORT statements, as suggested by Oliver. If you assemble and
link this file, you will get a binary that contains all of the library.

From the debug info file of this binary, you can then generate a new assembler
module that contains definitions for all of the exports. If you link this
module to your EEPROM based game instead of the C library, the code will jump
directly to the location, where the subroutine lies in memory. As Oliver
already pointed out, Kontiki uses this method to let the loadable module reuse
library routines that are already linked to the main program.

> Or perhaps "everything" is too much for the limited ram space.

This may be true but is easily solved by removing lesser needed routines from
the .FORCEIMPORT list.

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, 14 Feb 2006 20:17:19 +0100

This archive was generated by hypermail 2.1.8 : 2006-02-14 20:17:36 CET