public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: root@jacob.remcomp.fr (root)
To: gnu-win32@cygnus.com
Subject: Mr Taylor surely understands ld: a correction to my previous post
Date: Tue, 25 Mar 1997 20:52:00 -0000	[thread overview]
Message-ID: <m0w9aec-000AK1C@jacob.remcomp.fr> (raw)
In-Reply-To: <9703251732.AA18168@tweedledumb.cygnus.com>

I sent earlier this morning a message stating that nobody understands ld.

This is surely not true for Mr Taylor.

I saw his comments when reading ld's code, and they were helpful.
I just let myself go, expressing (for the first time I think) this feeling of
frustration I got from my weeks studying that code.

There are some basic rules of software engineering that we somehow take for
granted. For instance, a .h file contains declarations, and a .c file contains
executable code. This is not the case with 'ld'. The file 'coff.h' contains
executable code that is included TWICE (yes, the same file) in the code of
'ld' with different #defines as input. This works because all the functions
in that file are declared static and accessed by several indirection tables. 

Problem is, most debuggers get confused with this... not to speak of the poor 
guy *reading* that code!

But it is the whole philosophy behind this that is flawed. 
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.

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

Besides, 99.9999% of the people that use 'ld' daily, are loading that code 
to produce S records FOR NOTHING. The linker takes more space and is more
difficult to maintain! 

MODULARITY is a thing that got lost in this 'ld' crazyness. Do a program to
do ONE THING and do that well. Do another program for another task. Do not
build program upon program in the same executable. You do not have a
razor inside your TV set in case you want to shave yourself when watching
TV!!!

The linker I wrote, went the opposite direction: It is FAST, and its size is
only 66K. It understands only ONE format: windows COFF object. It will crash
with any other object file. It doesn't produce S-records, but it does produce
a readable MAP FILE with the information of the offset of EACH LINE in your
object code. And it uses Microsoft's debug info format, so you can even
debug it... :-)

What are the consequences of building things like 'ld'?

They are better expressed by this (anonymous) comment
in the file 'reloc.c'

/* This relocation routine is used by some of the backend linkers.
   They do not construct asymbol or arelent structures, so there is no
   reason for them to use bfd_perform_relocation.  Also,               <<<<<
   bfd_perform_relocation is so hacked up it is easier to write a new  <<<<<
   function than to try to deal with it.                               <<<<<
*/

So, instead of dealing with 'bfd_perform_relocation', that should relocate
object code from one object format into another (!!), people write their own
routines again, since that function is beyond what a human mind can follow!


The fact remains, that ld is producing bad executables since a long time.
Sometimes. When the program gets big enough, or when somehow a new API call
is invoked. There were people that pointed that out 2-3 months ago. A program
stopped working when it reached a size threshold. I have seen no announcements
of any corrections.

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.

-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

  reply	other threads:[~1997-03-25 20:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-25 12:55 Nobody in the world understands Gnu's 'ld' Ian Lance Taylor
1997-03-25 20:52 ` root [this message]
1997-03-27  8:16   ` Mr Taylor surely understands ld: a correction to my previous post 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0w9aec-000AK1C@jacob.remcomp.fr \
    --to=root@jacob.remcomp.fr \
    --cc=gnu-win32@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).