public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Global constructor mangling
@ 2002-08-05 23:52 Simon Gittins
  2002-08-06  0:35 ` bjorn rohde jensen
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Gittins @ 2002-08-05 23:52 UTC (permalink / raw)
  To: 'gcc-help@gnu.org'

Hi 

I would like to know how gcc mangles the following types of symbols:

#objdump -tC <library>
....
....
000000xxxxxxx           l     F      .text                global
constructors keyed to OS_TLI.cpp0xYLka 
....
....

In particular, I would like to produce the same mangled name on a number of
different hosts (it is a requirement that we are able to build a piece of
software identically on a number of internally managed hosts).

Both hosts run gcc 2.95.3 under gnu/linux.

I am unsure why they are not producing the same binaries.  Both hosts have
the source tree located in the same place, and use the same build process to
make the binaries.  

In a large library (I'm building libACE), it looks like these (there are
only about 20 'global constructors keyed to ...' symbols) are the only ones
that differ between the binaries produced by the two hosts.

Please CC me any reply.

Thanks in advance
Simon Gittins


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Global constructor mangling
  2002-08-05 23:52 Global constructor mangling Simon Gittins
@ 2002-08-06  0:35 ` bjorn rohde jensen
  2002-08-06 11:24   ` Alexy Khrabrov
  0 siblings, 1 reply; 5+ messages in thread
From: bjorn rohde jensen @ 2002-08-06  0:35 UTC (permalink / raw)
  To: Simon Gittins; +Cc: 'gcc-help@gnu.org'

Hi Simon,

 The name mangling scheme is pretty much a compiler
implementation issue, so i would question the wisdom
of an organization placing certain requirements on it:)
If you really want to know, how it is done in gcc/g++,
i guess, you could get involved in the development of
gcc....
 I am a bit puzzled, that the same version of g++ on
identical hosts would name mangle differently. I have
not experienced that sort of thing before.

Yours sincerely,

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Global constructor mangling
  2002-08-06  0:35 ` bjorn rohde jensen
@ 2002-08-06 11:24   ` Alexy Khrabrov
  2002-08-06 12:32     ` bjorn rohde jensen
  0 siblings, 1 reply; 5+ messages in thread
From: Alexy Khrabrov @ 2002-08-06 11:24 UTC (permalink / raw)
  To: bjensen; +Cc: Simon Gittins, 'gcc-help@gnu.org'


GCC 3.1 says it has a new mangling scheme.  In fact, code compiled
with g++ 2.95.3 doesn't link to g++ 3.1 libraries in a usual way.

I wonder whether I can instruct the (new?) linker to link old code
with the new libstdc++?  Is it at all possible?  Or do I have to recompile
my whole Linux dustribution?  :-)

Cheers,
Alexy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Global constructor mangling
  2002-08-06 11:24   ` Alexy Khrabrov
@ 2002-08-06 12:32     ` bjorn rohde jensen
  0 siblings, 0 replies; 5+ messages in thread
From: bjorn rohde jensen @ 2002-08-06 12:32 UTC (permalink / raw)
  To: Alexy Khrabrov; +Cc: Simon Gittins, 'gcc-help@gnu.org'

Hi Alexy,

 Part of the idea behind name mangling is to
protect against accidentally linking incompatible
object files together, so it is certainly best, if
you make sure, you are using C++ object files
generated by 1 and only 1 compiler. Plain C code is
more forgiving, so you probably dont need to
recompile the entire distributions system libraries,
which really would be a pain;) This is my experience
at least.
 One can not take successful linkage as a guarantee
of much besides no unresolved symbols, just like
successful compilation does not ensure code sanity:)

Yours sincerely,

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Global constructor mangling
@ 2002-08-06 18:58 Simon Gittins
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Gittins @ 2002-08-06 18:58 UTC (permalink / raw)
  To: 'bjensen@fastmail.fm'; +Cc: 'gcc-help@gnu.org'

Hi Bjorn

>  The name mangling scheme is pretty much a compiler
> implementation issue, so i would question the wisdom
> of an organization placing certain requirements on it:)

I agree completely :)

It's a regulatory requirement (not imposed by us), and it has proved rather
difficult to get it changed.  The only thing going in our favour is that we
supply the verification PC, so we can configure our build box identically to
the verification box.  

The offending symbols all appear to be statically instantiated objects in
dynamic libraries.  

Running gcc -E on the files in question gives identical results.

Both boxes have identical gcc drivers programs, specs, and gcc-lib contents
(collect2,cc1plus etc).

> If you really want to know, how it is done in gcc/g++,
> i guess, you could get involved in the development of
> gcc....

It may be my only choice.  I'll see if I can get my head around the mangling
code in the gcc source.

Best Regards
Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-08-07  1:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-05 23:52 Global constructor mangling Simon Gittins
2002-08-06  0:35 ` bjorn rohde jensen
2002-08-06 11:24   ` Alexy Khrabrov
2002-08-06 12:32     ` bjorn rohde jensen
2002-08-06 18:58 Simon Gittins

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).