Subject: Re: Nobody in the world understands Gnu's 'ld'.
From: [email-masked] (Fergus Henderson)

26 Mar 1997 14:33:07 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked] (root)
Original-Cc: [email-masked] (gnu-win32)
In-Reply-To: <[email-masked]> from "root" at Mar 25, 97 08:23:33 am
X-Mailer: ELM [version 2.4 PL24]
Original-Sender: [email-masked]

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

-- 
Fergus Henderson <[email-masked]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [email-masked]         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".