Mail Archives: djgpp/2001/03/25/13:55:35
On Sun, 25 Mar 2001, Eli Zaretskii wrote:
> > From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: 25 Mar 2001 16:12:19 GMT
> >
> > Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> > [...]
> > > You forgot that ld.exe is a one-pass linker: it only scans the
> > > libraries once, in the order you specify them in the link command
> > > line.
> >
> > Hmmm... but isn't this true only for those libraries you specify with
> > -l arguments? Libs given by actual filename (like the OP's
> > c:/.../libmwin.a) are treated like .o files, and those are not subject
> > to one-pass-only treatment, AFAIK.
>
> Are you saying that if I use libc.a instead of -lc, the linker pulls
> the _entire_ library into the executable? That would be the only way
> it could work around its one-pass nature. I doubt that the linker
> does that, though.
Turns out Eli's right, as usual. -lname is exactly equivalent to passing
the full name /some/directory/name/libname.a, including the fact that
it'll only be parsed once, at the place it occurs.
So, to overcome the OP's problem, the --( --) approach or repeated listing
of the same library is, indeed, necessary.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -