Linking in gcc/g++ with different results.

Garrett Kajmowicz gkajmowi@tbaytel.net
Thu Jun 2 05:36:00 GMT 2005


In the following, gcc refers to the C compiler, g++ to the c++ compiler.

I'm working on the free embedded c++ library at cxx.uclibc.org.
It has recently come to my attention that linking with gcc vs. g++ causes 
different results.

My library is compiled into object files individually.  These files are then 
linked together using either gcc or g++.  If they are linked together using 
gcc everything works well - my test suite compiles and runs properly.  If I 
simply substitute g++ for gcc in the linking step, my applications segfault.

I need to know if this is a code error on my part (possible - some of this 
code is not well tested), or a gcc error (also possible - two different 
results should not happen).

The flags used are identical, and are as follows:

gcc  -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,defs 
algorithm.o bitset.o char_traits.o complex.o .....

Thanks for the insight as to why this is happening.


-	Garrett Kajmowicz



More information about the Gcc-help mailing list