Re: [cc65] Specifying segment for library code?

From: Oliver Schmidt <ol.sc1web.de>
Date: 2012-06-02 22:55:05
Hi,

>>    For example,  if I have an overlay that uses strncmp, but the main program
>>    doesn't, it would be nice to be able to tell the linker to link strncmp to
>>    the overlay and not to the main program.

> That is possible with an intermediate step. Use the linker to create your main
> program. Use some perl magic to retrieve all identifiers from the map file and
> generate an asm file with "name := value" pairs. Then assemble and link this
> object file to the overlays. As a result, the overlays will use functions in
> the main program, if they are already there, and have their own copies of
> everything else.

As far as I understand that approach would link strncmp into the main
program and allow to use it from the overlay _too_. The question here
was to have it linked into the overlay _only_.

The (more usual) scenario of linking all library stuff needed by any
overlay into main can easily archived by by linking the main and all
overlays in one single linker "session" as shown in the overlay sample
contained in the last cc65 release (but not the present in the current
snapshot !).

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jun 2 23:00:22 2012

This archive was generated by hypermail 2.1.8 : 2012-06-02 23:00:25 CEST