public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Same internal function name in libstdc++.so.5 and libjvm.so
@ 2003-09-04 16:08 lrtaylor
  2003-09-04 16:12 ` Ajay Bansal
  2003-09-04 16:12 ` Ajay Bansal
  0 siblings, 2 replies; 6+ messages in thread
From: lrtaylor @ 2003-09-04 16:08 UTC (permalink / raw)
  To: abansal, gcc-help

Hi,

Can you change your link line so that libstdc++ is linked to before libjvm?  If I understand correctly, it should get the function our of the first library linked to that defines it (I could be wrong, though...)

Lyle Taylor

 -----Original Message-----
From: 	Ajay Bansal [mailto:abansal@netegrity.com] 
Sent:	Thursday, September 04, 2003 5:17 AM
To:	gcc-help@gcc.gnu.org
Subject:	Same internal function name in libstdc++.so.5 and libjvm.so

Hi All


We are facing a "same function name" issue in two different libraries on
Linux. My program is linked with both libstdc++ and libjvm. I am using gcc
3.2.1 on Linux.

My code has following line : 

dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

Which dumps core.

As it was not very clear why this piece of code can give a dump, I changed
the code as follows:

        if ( dynamic_cast<CSObject*>(m_unresolved))
	
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

 
Now core comes while executing "if" statement. I have checked for validity
of pointers "m_unresolved" and "lpszSString". Both are valid.   

On Linux, with gcc 3.2.1, dynamic_cast internally calls function
"__dynamic_cast". Problem is - this function is present both in
libstdc++.so.5 and libjvm.so. In our code, function from libjvm is being
called. If I change dynamic_cast to simple C style cast, everything works
fine. (nm for libstdc_++ and libjvm is given below)

----------------------------------------
[abansal@linux2 lib]$ nm -A *.so.* |grep __dynamic
libstdc++.so.5:00051bc0 T __dynamic_cast .so.5.0.1:00051bc0 T 
libstdc++__dynamic_cast

[abansal@linux2 lib]$ nm /usr/j2sdk1.4.1_02/jre/lib/i386/server/libjvm.so
|grep __dynamic
00485c34 T __dynamic_cast
----------------------------------------


Changing all dynamic_casts to simple C style casts in the code solves the
issue, but I know that that is undesirable. Can somebody please suggest us
what should we do in this case?


Regards
Ajay 
 


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

* RE: Same internal function name in libstdc++.so.5 and libjvm.so
  2003-09-04 16:08 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
@ 2003-09-04 16:12 ` Ajay Bansal
  2003-09-04 16:12 ` Ajay Bansal
  1 sibling, 0 replies; 6+ messages in thread
From: Ajay Bansal @ 2003-09-04 16:12 UTC (permalink / raw)
  To: gcc-help

But I don't _link_ with libstdc++ explicitly!!!!!!!!!!!!!!!!!!!!!!! It is
linked implicitly by g++ compiler.

(Am I correct??) 


-----Original Message-----
From: lrtaylor@micron.com [mailto:lrtaylor@micron.com] 
Sent: Thursday, September 04, 2003 9:39 PM
To: abansal@netegrity.com; gcc-help@gcc.gnu.org

Hi,

Can you change your link line so that libstdc++ is linked to before libjvm?
If I understand correctly, it should get the function our of the first
library linked to that defines it (I could be wrong, though...)

Lyle Taylor

 -----Original Message-----
From: 	Ajay Bansal [mailto:abansal@netegrity.com] 
Sent:	Thursday, September 04, 2003 5:17 AM
To:	gcc-help@gcc.gnu.org
Subject:	Same internal function name in libstdc++.so.5 and libjvm.so

Hi All


We are facing a "same function name" issue in two different libraries on
Linux. My program is linked with both libstdc++ and libjvm. I am using gcc
3.2.1 on Linux.

My code has following line : 

dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

Which dumps core.

As it was not very clear why this piece of code can give a dump, I changed
the code as follows:

        if ( dynamic_cast<CSObject*>(m_unresolved))
	
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

 
Now core comes while executing "if" statement. I have checked for validity
of pointers "m_unresolved" and "lpszSString". Both are valid.   

On Linux, with gcc 3.2.1, dynamic_cast internally calls function
"__dynamic_cast". Problem is - this function is present both in
libstdc++.so.5 and libjvm.so. In our code, function from libjvm is being
called. If I change dynamic_cast to simple C style cast, everything works
fine. (nm for libstdc_++ and libjvm is given below)

----------------------------------------
[abansal@linux2 lib]$ nm -A *.so.* |grep __dynamic
libstdc++.so.5:00051bc0 T __dynamic_cast .so.5.0.1:00051bc0 T 
libstdc++__dynamic_cast

[abansal@linux2 lib]$ nm /usr/j2sdk1.4.1_02/jre/lib/i386/server/libjvm.so
|grep __dynamic
00485c34 T __dynamic_cast
----------------------------------------


Changing all dynamic_casts to simple C style casts in the code solves the
issue, but I know that that is undesirable. Can somebody please suggest us
what should we do in this case?


Regards
Ajay 
 

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

* RE: Same internal function name in libstdc++.so.5 and libjvm.so
  2003-09-04 16:08 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
  2003-09-04 16:12 ` Ajay Bansal
@ 2003-09-04 16:12 ` Ajay Bansal
  1 sibling, 0 replies; 6+ messages in thread
From: Ajay Bansal @ 2003-09-04 16:12 UTC (permalink / raw)
  To: gcc-help

But I don't _link_ with libstdc++ explicitly!!!!!!!!!!!!!!!!!!!!!!! It is
linked implicitly by g++ compiler.

(Am I correct??) 


-----Original Message-----
From: lrtaylor@micron.com [mailto:lrtaylor@micron.com] 
Sent: Thursday, September 04, 2003 9:39 PM
To: abansal@netegrity.com; gcc-help@gcc.gnu.org

Hi,

Can you change your link line so that libstdc++ is linked to before libjvm?
If I understand correctly, it should get the function our of the first
library linked to that defines it (I could be wrong, though...)

Lyle Taylor

 -----Original Message-----
From: 	Ajay Bansal [mailto:abansal@netegrity.com] 
Sent:	Thursday, September 04, 2003 5:17 AM
To:	gcc-help@gcc.gnu.org
Subject:	Same internal function name in libstdc++.so.5 and libjvm.so

Hi All


We are facing a "same function name" issue in two different libraries on
Linux. My program is linked with both libstdc++ and libjvm. I am using gcc
3.2.1 on Linux.

My code has following line : 

dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

Which dumps core.

As it was not very clear why this piece of code can give a dump, I changed
the code as follows:

        if ( dynamic_cast<CSObject*>(m_unresolved))
	
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

 
Now core comes while executing "if" statement. I have checked for validity
of pointers "m_unresolved" and "lpszSString". Both are valid.   

On Linux, with gcc 3.2.1, dynamic_cast internally calls function
"__dynamic_cast". Problem is - this function is present both in
libstdc++.so.5 and libjvm.so. In our code, function from libjvm is being
called. If I change dynamic_cast to simple C style cast, everything works
fine. (nm for libstdc_++ and libjvm is given below)

----------------------------------------
[abansal@linux2 lib]$ nm -A *.so.* |grep __dynamic
libstdc++.so.5:00051bc0 T __dynamic_cast .so.5.0.1:00051bc0 T 
libstdc++__dynamic_cast

[abansal@linux2 lib]$ nm /usr/j2sdk1.4.1_02/jre/lib/i386/server/libjvm.so
|grep __dynamic
00485c34 T __dynamic_cast
----------------------------------------


Changing all dynamic_casts to simple C style casts in the code solves the
issue, but I know that that is undesirable. Can somebody please suggest us
what should we do in this case?


Regards
Ajay 
 

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

* RE: Same internal function name in libstdc++.so.5 and libjvm.so
@ 2003-09-04 23:03 lrtaylor
  0 siblings, 0 replies; 6+ messages in thread
From: lrtaylor @ 2003-09-04 23:03 UTC (permalink / raw)
  To: abansal, gcc-help

You are correct.  However, you can still add it explicitly to the command line with g++ (if you're using gcj, then I'm not sure).  For example,

g++ -o prog file.cpp -lstdc++ -lsomeotherlib 

Now, if you do an 'ldd' on 'prod', you should see libstdc++ before libsomeotherlib.

Lyle

 -----Original Message-----
From: 	Ajay Bansal [mailto:abansal@netegrity.com] 
Sent:	Thursday, September 04, 2003 10:16 AM
To:	gcc-help@gcc.gnu.org
Subject:	RE: Same internal function name in libstdc++.so.5 and libjvm.so

But I don't _link_ with libstdc++ explicitly!!!!!!!!!!!!!!!!!!!!!!! It is
linked implicitly by g++ compiler.

(Am I correct??) 


-----Original Message-----
From: lrtaylor@micron.com [mailto:lrtaylor@micron.com] 
Sent: Thursday, September 04, 2003 9:39 PM
To: abansal@netegrity.com; gcc-help@gcc.gnu.org

Hi,

Can you change your link line so that libstdc++ is linked to before libjvm?
If I understand correctly, it should get the function our of the first
library linked to that defines it (I could be wrong, though...)

Lyle Taylor

 -----Original Message-----
From: 	Ajay Bansal [mailto:abansal@netegrity.com] 
Sent:	Thursday, September 04, 2003 5:17 AM
To:	gcc-help@gcc.gnu.org
Subject:	Same internal function name in libstdc++.so.5 and libjvm.so

Hi All


We are facing a "same function name" issue in two different libraries on
Linux. My program is linked with both libstdc++ and libjvm. I am using gcc
3.2.1 on Linux.

My code has following line : 

dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

Which dumps core.

As it was not very clear why this piece of code can give a dump, I changed
the code as follows:

        if ( dynamic_cast<CSObject*>(m_unresolved))
	
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

 
Now core comes while executing "if" statement. I have checked for validity
of pointers "m_unresolved" and "lpszSString". Both are valid.   

On Linux, with gcc 3.2.1, dynamic_cast internally calls function
"__dynamic_cast". Problem is - this function is present both in
libstdc++.so.5 and libjvm.so. In our code, function from libjvm is being
called. If I change dynamic_cast to simple C style cast, everything works
fine. (nm for libstdc_++ and libjvm is given below)

----------------------------------------
[abansal@linux2 lib]$ nm -A *.so.* |grep __dynamic
libstdc++.so.5:00051bc0 T __dynamic_cast .so.5.0.1:00051bc0 T 
libstdc++__dynamic_cast

[abansal@linux2 lib]$ nm /usr/j2sdk1.4.1_02/jre/lib/i386/server/libjvm.so
|grep __dynamic
00485c34 T __dynamic_cast
----------------------------------------


Changing all dynamic_casts to simple C style casts in the code solves the
issue, but I know that that is undesirable. Can somebody please suggest us
what should we do in this case?


Regards
Ajay 
 


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

* Same internal function name in libstdc++.so.5 and libjvm.so
  2003-09-04 10:13 problem on building gcc 3.3.1 on AIX5.2 Claudio Bley
@ 2003-09-04 11:12 ` Ajay Bansal
  2003-09-04 11:12 ` Ajay Bansal
  1 sibling, 0 replies; 6+ messages in thread
From: Ajay Bansal @ 2003-09-04 11:12 UTC (permalink / raw)
  To: gcc-help

Hi All


We are facing a "same function name" issue in two different libraries on
Linux. My program is linked with both libstdc++ and libjvm. I am using gcc
3.2.1 on Linux.

My code has following line : 

dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

Which dumps core.

As it was not very clear why this piece of code can give a dump, I changed
the code as follows:

        if ( dynamic_cast<CSObject*>(m_unresolved))
	
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

 
Now core comes while executing "if" statement. I have checked for validity
of pointers "m_unresolved" and "lpszSString". Both are valid.   

On Linux, with gcc 3.2.1, dynamic_cast internally calls function
"__dynamic_cast". Problem is - this function is present both in
libstdc++.so.5 and libjvm.so. In our code, function from libjvm is being
called. If I change dynamic_cast to simple C style cast, everything works
fine. (nm for libstdc_++ and libjvm is given below)

----------------------------------------
[abansal@linux2 lib]$ nm -A *.so.* |grep __dynamic
libstdc++.so.5:00051bc0 T __dynamic_cast .so.5.0.1:00051bc0 T 
libstdc++__dynamic_cast

[abansal@linux2 lib]$ nm /usr/j2sdk1.4.1_02/jre/lib/i386/server/libjvm.so
|grep __dynamic
00485c34 T __dynamic_cast
----------------------------------------


Changing all dynamic_casts to simple C style casts in the code solves the
issue, but I know that that is undesirable. Can somebody please suggest us
what should we do in this case?


Regards
Ajay 
 

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

* Same internal function name in libstdc++.so.5 and libjvm.so
  2003-09-04 10:13 problem on building gcc 3.3.1 on AIX5.2 Claudio Bley
  2003-09-04 11:12 ` Same internal function name in libstdc++.so.5 and libjvm.so Ajay Bansal
@ 2003-09-04 11:12 ` Ajay Bansal
  1 sibling, 0 replies; 6+ messages in thread
From: Ajay Bansal @ 2003-09-04 11:12 UTC (permalink / raw)
  To: gcc-help

Hi All


We are facing a "same function name" issue in two different libraries on
Linux. My program is linked with both libstdc++ and libjvm. I am using gcc
3.2.1 on Linux.

My code has following line : 

dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

Which dumps core.

As it was not very clear why this piece of code can give a dump, I changed
the code as follows:

        if ( dynamic_cast<CSObject*>(m_unresolved))
	
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);

 
Now core comes while executing "if" statement. I have checked for validity
of pointers "m_unresolved" and "lpszSString". Both are valid.   

On Linux, with gcc 3.2.1, dynamic_cast internally calls function
"__dynamic_cast". Problem is - this function is present both in
libstdc++.so.5 and libjvm.so. In our code, function from libjvm is being
called. If I change dynamic_cast to simple C style cast, everything works
fine. (nm for libstdc_++ and libjvm is given below)

----------------------------------------
[abansal@linux2 lib]$ nm -A *.so.* |grep __dynamic
libstdc++.so.5:00051bc0 T __dynamic_cast .so.5.0.1:00051bc0 T 
libstdc++__dynamic_cast

[abansal@linux2 lib]$ nm /usr/j2sdk1.4.1_02/jre/lib/i386/server/libjvm.so
|grep __dynamic
00485c34 T __dynamic_cast
----------------------------------------


Changing all dynamic_casts to simple C style casts in the code solves the
issue, but I know that that is undesirable. Can somebody please suggest us
what should we do in this case?


Regards
Ajay 
 

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

end of thread, other threads:[~2003-09-04 23:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-04 16:08 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
2003-09-04 16:12 ` Ajay Bansal
2003-09-04 16:12 ` Ajay Bansal
  -- strict thread matches above, loose matches on Subject: below --
2003-09-04 23:03 lrtaylor
2003-09-04 10:13 problem on building gcc 3.3.1 on AIX5.2 Claudio Bley
2003-09-04 11:12 ` Same internal function name in libstdc++.so.5 and libjvm.so Ajay Bansal
2003-09-04 11:12 ` Ajay Bansal

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