public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Nobody in the world understands Gnu's 'ld'.
@ 1997-03-25 12:55 Ian Lance Taylor
  1997-03-25 20:52 ` Mr Taylor surely understands ld: a correction to my previous post root
  1997-03-25 23:17 ` Nobody in the world understands Gnu's 'ld' Fergus Henderson
  0 siblings, 2 replies; 15+ messages in thread
From: Ian Lance Taylor @ 1997-03-25 12:55 UTC (permalink / raw)
  To: root; +Cc: gnu-win32

In gnu-win32 root@jacob.remcomp.fr writes:

>Since several months people here report that Cygnus's linker is flawed.
>I think that it is just plain that Cygnus doesn't have the
>know-how to repair it, since Steve Chamberlain, the guy that
>wrote most of it, hasn't posted anything here since ages and
>he was very active before.

Let's not get carried away here.  I understand the linker perfectly
well, and so do a number of other people.

It's true that Steve Chamberlain left Cygnus a while ago.

If you look at the ChangeLog files, you can see who has been working
on the linker and other parts of BFD.  You'll see that although Steve
wrote most of the original code several years ago, he hasn't been
heavily involved with BFD or the linker for quite some time.

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

It's true that it is rare for people to link together different object
file formats.  However, you have missed the actual reasons for the
complexity.

The first reason is that the linker is able to generate an object file
format which is different from the input file formats.  For example,
this permits the linker to directly generate S-record output without
requiring a convertor.  This may not be too useful for native
programmers, but it is useful for embedded systems programmers.

The second reason is that a single linker binary can serve as the
linker for different targets.  The Linux people use this, for example:
the binary binutils distribution for Linux is built to support all the
various Linux targets in a single binary.

>It has a full blown LANGUAGE
>(with lex+yacc parser/lexer!) that is supposed to recognize linker
>commands. Obviously nobody ever uses it, but to understand
>what the linker is doing you have to go through yet another layer
>of complexity.

In fact, many people use the linker script language.  I can't imagine
why you think that nobody uses it.  Moreover, this is hardly a unique
or even unusual feature of the GNU linker: most linkers have a
scripting language, and the one used by the GNU linker is based on the
one used by the SVR3 linker.

>Then you have the 'BFD' format, that is supposed to be an universal
>binary format designed by GNU that will abstract the binary format
>of all machines in the western world into ONE format. Obviously
>it doesn't work, but then you have not only to understand what
>binary format you have in windows (what is difficult enough) but
>you have to understand BFD too.

In fact, BFD works quite well.  I don't know why you think that it
doesn't work.

It's not quite correct to describe BFD as abtracting all binary
formats into one format.  What it actually does is provide a library
interface which may be used to examine and generate an object file in
any format.

Mind you, I'm not going to defend the way that BFD is written.  There
is definitely a very steep learning curve before being able to program
using BFD.  I've tried to clean up some of the more egregious
problems.  Unfortunately, the cost of rewriting BFD is high.

>And to crown this beatiful construction there is NO DOCUMENTATION
>whatsoever about anything I have told you in this message. I inferred
>this from reading THE C CODE!!!

I'd love to have some documentation if you care to write some and
contribute it.  This is, after all, free software.  It improves by
contributions.

>That is why this linker can't even recognize MSVC object code
>format and use the MSVC .LIBs. Because nobody in the world
>is able to modify it. Of course we do not need compatibility
>with SUN or HP Unix under Windows 95. We would need MSVC
>compatibility. But to do that we would have to find somebody
>that understands 'ld'...

Well, all you need to do is add support for the object code format to
BFD.  I'm sorry you think that is impossible.  In fact, BFD supports a
number of object file formats already, including a.out, COFF, ELF,
IEEE-695, XCOFF, SOM, etc.  Adding another one is really not all that
difficult if you know what you are doing.

I'm always willing to answer specific questions about BFD and the
linker.  I'm not willing to give a tutorial on how to program it,
because I simply don't have the time.

I suppose I should add that my personal interest in adding MSVC object
support is nil.  I do work at Cygnus, but I don't work on gnu-win32,
and I have no idea whether Cygnus has any plans to do anything in this
area.

Ian
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Mr Taylor surely understands ld: a correction to my previous post
@ 1997-03-27  0:57 Ian Lance Taylor
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Lance Taylor @ 1997-03-27  0:57 UTC (permalink / raw)
  To: root; +Cc: gnu-win32

In cygnus.gnu-win32 root@jacob.remcomp.fr writes:

[ Various complaints about modularity and the like which I am not
  going to address.  Different people can reasonably have different
  opinions on these issues.  ]

>I still remain convinced that only Steve can fix this. It is a pity that he
>is gone. This means that this problem will remain as it is in the foreseeable
>future.

I just couldn't let this comment pass, though.  Steve is a great guy,
and a friend, but he is not the only person who can work on the
linker.  In fact, when we did the last major overhaul of the linker,
implementing the interface documented in bfd/linker.c, he designed it,
but I wrote it.  I understand the linker as well as he does.

In fact, the notion that only one person can work on a particular
program is nonsense.  I've never seen a useful program that I could
not understand and modify, if I was willing to take the time.  (This
is not meant as a challenge!)

Whether whatever Windows linker problem there may be will be fixed is
a different issue.  Steve used Windows, and wrote the original
gnu-win32 library, and cared about making the linker do the right
thing under Windows.  I don't use Windows, and although I would be
happy to help anybody fix any possible problems of the linker under
Windows insofar as I am able, I'm not likely to do anything about it
myself.  I have no idea what Cygnus's plans are in regards to the
linker under Windows.  I have no idea whether there really are any
linker problems, or how serious they are if they exist.

Ian
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Mr Taylor surely understands ld: a correction to my previous post
@ 1997-03-27 15:33 dahms
  1997-03-28 10:32 ` Christoph Kukulies
  0 siblings, 1 reply; 15+ messages in thread
From: dahms @ 1997-03-27 15:33 UTC (permalink / raw)
  To: root; +Cc: gnu-win32, dahms

Hi Jacob, you wrote:

: Mr Taylor writes:
: 
: > ...the linker is able to generate an object file
: > format which is different from the input file formats.  For example,
: > this permits the linker to directly generate S-record output without
: > requiring a convertor.

What is an S-record, please?

: But WHY do we have to put the convertor and the linker in the SAME PROGRAM!!!
: In my view of things, it would be much better to have an easy to understand
: convertor to be used by systems programmers when they need S records, than
: to overload the linker with YET ANOTHER LEVEL OF COMPLEXITY!!!

In the same program, they can't get out-of-sync, when it's updated.
And nowadays, only the needed stuff is paged in.


Bye, Heribert (dahms@ifk20.mach.uni-karlsruhe.de)
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~1997-03-29  0:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-25 12:55 Nobody in the world understands Gnu's 'ld' Ian Lance Taylor
1997-03-25 20:52 ` Mr Taylor surely understands ld: a correction to my previous post root
1997-03-27  8:16   ` Fergus Henderson
1997-03-25 23:17 ` Nobody in the world understands Gnu's 'ld' Fergus Henderson
1997-03-26 10:43   ` Joel Dinolt
1997-03-27  9:46     ` Fergus Henderson
1997-03-27 20:59   ` Pedro A. Aranda Gutiirrez
1997-03-27  9:46     ` Ian Lance Taylor
1997-03-28 10:32       ` Commercial Licensing David Essex
1997-03-28 19:43         ` Jim Balter
1997-03-29  0:06         ` Geoffrey Noer
1997-03-27 22:51   ` Nobody in the world understands Gnu's 'ld' Ian Lance Taylor
1997-03-27  0:57 Mr Taylor surely understands ld: a correction to my previous post Ian Lance Taylor
1997-03-27 15:33 dahms
1997-03-28 10:32 ` Christoph Kukulies

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).