General linking question

Peter Naulls peter at
Wed Aug 28 01:54:33 PDT 2002

In message <4b6d00a4basbellon at>
          Stefan Bellon <sbellon at> wrote:

> Hi!
> I've got a general question concerning linking under RISC OS.
> Let's assume that I have three object files: A, B and C. B and C are
> libraries. B depends on C because it refers to one symbol from C. But
> this is only needed in one function of B. Now, in order to get a
> working executable of A, A has to be linked against B, but doesn't make
> use of the function in B that needs the symbol from C.
> How to link A and B together without the need of C? Is this possible
> under RISC OS?

If my understanding of linker semantics is correct, then the way to
do this is to split the functions up in B into smaller objects.  i.e.
A uses functions in B that are in the same object file as functions
which rely upon C.

 Peter Naulls - peter at
 Homepage                     -
 RISC OS C Programming        -
 Unix Programs on RISC OS     -
Free RISC OS Hosting -

More information about the gcc mailing list