Re: How do linkers deal with C++ duplicate code?

David Stes <stes@mundivia.es>
22 Aug 1998 23:28:35 -0400

          From comp.compilers

Related articles
How do linkers deal with C++ duplicate code? johnl@iecc.com (John R Levine) (1998-08-20)
Re: How do linkers deal with C++ duplicate code? johnmce@world.std.com (1998-08-20)
Re: How do linkers deal with C++ duplicate code? stes@mundivia.es (David Stes) (1998-08-20)
Re: How do linkers deal with C++ duplicate code? urs@cs.ucsb.edu (Urs Hoelzle) (1998-08-20)
Re: How do linkers deal with C++ duplicate code? dlmoore@molalla.net (David L Moore) (1998-08-22)
Re: How do linkers deal with C++ duplicate code? dwight@pentasoft.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? stes@mundivia.es (David Stes) (1998-08-22)
Re: How do linkers deal with C++ duplicate code? saroj@bear.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? jacob@jacob.remcomp.fr (1998-08-22)
Re: How do linkers deal with C++ duplicate code? ian@cygnus.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? mrs@kithrup.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? mrs@kithrup.com (1998-08-22)
Re: How do linkers deal with C++ duplicate code? bowdidge@watson.ibm.com (Robert Bowdidge) (1998-08-24)
[4 later articles]
| List of all articles for this month |

From: David Stes <stes@mundivia.es>
Newsgroups: comp.compilers
Date: 22 Aug 1998 23:28:35 -0400
Organization: Compilers Central
References: 98-08-147 98-08-150
Keywords: linker, C++

> I don't mind the grossness, I used to hand-punch 360/20 object code
> into cards on keypunches and you can't get much grosser than that.


:-)


> you have to hand-enumerate every possible thing that might have an
> initializer somewhere and it won't complain if you forget something.


Clearly, in practice, you have the symbols automatically generated ...


The basic idea for that, is that a module defines the symbol that
corresponds to itself as its initializer routine; for modules that are
#include'd, on the other hand, uninitialized symbols are emitted.


So basically you move the problem from the link editor to the compiler ...
The compiler does the enumeration of the symbols that are then merged by
the link editor.


But it means that you can link with an unmodified link editor.


In some environments it may be easy to replace the link editor, but
often you can only add an additional linker (or front-end) and then it
gets confusing which objects to link with which linker ... so in that
case, when you're not the maintainer of the system link editor, some
of the good old hacks may be useful !
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.