Subject: Re: Bad linker behaviour
From: [email-masked] (Ian Lance Taylor)

10 Oct 1997 07:06:08 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
To: [email-masked]
Cc: [email-masked]

   From: [email-masked]
   Date: Thu, 9 Oct 1997 08:41:54 -0600

   When gcc compiles a file, there are two symbols that it adds to the object
   module, `___gnu_compiled_c' and `gcc2_compiled.'.  For a C++ file, I see
   that `__gnu_compiled_cplusplus' and `gcc2_compiled.' are defined.  So, it
   seems that ld could watch for `___gnu_compiled_c' in an object file and
   flag it for removing the leading '_'  on symbols from that module, and
   if it sees `__gnu_compiled_cplusplus' it would demangle symbols from that
   object module, otherwise it would leave the symbol alone.

That sounds like a plausible idea to me.  I'm not sure how difficult
it would be to implement: I believe that there are a number of cases
that print a symbol name which do not have any record of which module
it was defined in.

I don't plan to implement this myself, but I would be happy to look at
patches for it.

Ian
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".