Re: [cc65] linker

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-04-12 14:27:29
Hi!

On Mon, Apr 12, 2004 at 11:00:48AM +0200, gerhard wrote:
> if i write different procedures and compile/assemble them into one object
> file for each, include the .o files in an library and then use one of the
> procedures in another program, only one gets linked.
> But if i use only one object file for all procedures and don't put them into
> a library and use one procedure in another program all get linked. Is there
> a reasonfor that behaviour?

An object file can only be included into the linker output file as a whole.
The decision, if an object file is included is based on two rules:

  1. If the object file is named explicitly on the command line, it is always
     included.

  2. If the object file is part of a library, it is included if there are
     references into this object file (the object file contains symbols
     referenced from elsewhere).

These rules are consistent with other compilers (gcc for example).

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 Mon Apr 12 14:27:34 2004

This archive was generated by hypermail 2.1.8 : 2004-04-12 14:27:40 CEST