General linking question

Stefan Bellon sbellon at
Wed Aug 28 02:54:18 PDT 2002

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


> > 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,

... but on GNU/Linux, the gcc linker handles it (I have been told).

> 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.

Yes, that's how I do it at present. But in order to keep the RISC OS
source as close as possible to the mainstream source it would be easier
if it worked otherwise.

RISC OS linkers are able to exclude unused areas from the executable.
But the dependence checks seem to be done prior to excluding unused
areas. Why isn't this swapped around? Then the unused areas can have
further dependences, but they needn't be fulfilled as the area is
unused and therefore excluded anyway.

 Stefan Bellon * <mailto:sbellon at> * <>
 PGP 2 and OpenPGP keys available from my home page

 We must proactively pursue enterprise-wide catalysts for change in
 order to efficiently foster long-term high-impact methods of
 empowerment to meet our deadlines.

More information about the gcc mailing list