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

mrs@kithrup.com (Mike Stump)
22 Aug 1998 23:36:13 -0400

          From comp.compilers

Related articles
[5 earlier articles]
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)
Re: How do linkers deal with C++ duplicate code? joachim.durchholz@munich.netsurf.de (Joachim Durchholz) (1998-08-25)
Re: How do linkers deal with C++ duplicate code? dlmoore@molalla.net (David L Moore) (1998-08-30)
Re: How do linkers deal with C++ duplicate code? zalman@netcom.com (1998-08-31)
| List of all articles for this month |

From: mrs@kithrup.com (Mike Stump)
Newsgroups: comp.compilers
Date: 22 Aug 1998 23:36:13 -0400
Organization: Kithrup Enterprises, Ltd.
References: 98-08-147 98-08-148
Keywords: linker, C++

John McEnerney <johnmce@world.std.com> wrote:
>One possibility is to compare the size/contents of duplicate modules and,
>if they match, discard all but one; otherwise report some sort of error.


Nope, can't work for C++. Please see the standard. Hint think about
how the contents change if you say -O9 in one translation unit and -00
in another. See my other post for how to overcome this.


>In the Metrowerks C/C++ compilers and linkers, we use a storage-class
>attribute that indicates that a symbol is expected to have multiple
>definitions, and that all are guaranteed by the compiler to have identical
>contents.


Hum, if you have it implemented, then, let me ask, do you actually
compare full contents? I hope not (unless you interpret the stuff).
--


Post a followup to this message

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