This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bad linker behaviour


In reference to ld doing demangling by default, Ian says:

>I would have no objection in principle to making this depend upon a
>command line option.  Unfortunately, compilers traditionally do not
>pass any such command line option.  gcc must work with either a native
>Unix linker or the GNU linker.  It can not pass a command line option
>that will only be understood by the GNU linker.  Therefore, I don't
>see any way to make this work correctly based on a command line
>option.

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.

Of course, this would have to depend on the source object module, once the
modules have started to be combined (or sub-linked via the -r flag) it
gets a bit more difficult to pick out what symbols came from where.

Does this have much merit?

marcus hall
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]