This is the mail archive of the
mailing list for the Cygwin project.
Re: Nobody in the world understands Gnu's 'ld'.
- To: root at jacob dot remcomp dot fr (root)
- Subject: Re: Nobody in the world understands Gnu's 'ld'.
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Date: Wed, 26 Mar 1997 17:40:54 +1100 (EST)
- Cc: gnu-win32 at cygnus dot com (gnu-win32)
Jacob Navia wrote:
> Gnu's linker: A NIGHTMARE!
... followed by a lot of nonsense and one good point.
> Since several months people here report that Cygnus's linker is flawed.
> Before writing my linker, I studied gnu's linker code with the
> naive assumption that I could use it. After spending weeks and weeks
> trying to understand it, I gave up and wrote mine.
> Just to give you an idea, ld is supposed to link an object file
> from sun's unix format with some code from windows 95 and with
> some code of hp Unix. Of course this is ridiculous and it will never
> work, but this is how 'ld' is designed: an incredible complexity
> that (to me) seems completely unwarranted.
As others have noted, the features that you complain about _are_
highly desirable and people do use them.
> And then you have the macro-sickness... You read:
> a = foobar(b->field);
> Well, where is foobar? Nowhere. It is a macro that will be expanded
> into an index into a table using b. Mmmm. This table is
> actually an table of tables. MMMMMMMMMMM. OK let's go on.
> In that table of tables you have a field that is a table of
> functions. GOD! WHATS THIS!!! But let's go on. That table
> of functions is indexed by that b->field to jump into ???
> IT DEPENDS OF THE RUNTIME CONDITIONS.
This sort of programming -- emulating C++ virtual functions in C -- is
a pretty common idiom (e.g. the Linux kernel uses similar techniques).
I didn't find it difficult to understand.
> And to crown this beatiful construction there is NO DOCUMENTATION
> whatsoever about anything I have told you in this message.
This is Jacob Navia's one good point.
It does seem to me that the authors of GNU ld
don't really have much idea about software engineering.
For example, there are some functions in there that are
thousands of lines long. Yes, that's right, 5000 lines
of code, all of it a single C function.
Documentation and proper structuring of code should NOT be
Fergus Henderson <firstname.lastname@example.org> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger email@example.com | -- the last words of T. S. Garp.
For help on using this list, send a message to
"firstname.lastname@example.org" with one line of text: "help".