Bug 110438 - dynamic_cast fails depending on linking combination
Summary: dynamic_cast fails depending on linking combination
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc
Version: 3.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-19 16:22 UTC by Göran Uddeborg
Modified: 2007-11-30 22:06 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2003-11-20 00:28:41 UTC


Attachments (Terms of Use)
Test case referred to in the initial report (1.18 KB, application/x-gzip)
2003-11-19 16:25 UTC, Göran Uddeborg
no flags Details

Description Göran Uddeborg 2003-11-19 16:22:36 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

Description of problem:
An application we have link different parts in different ways, archive
library, shared library, and at run time with dlopen().  In some cases
we have found dynamic_cast fails.  I believe the attached test case
best illustrates this.  It is essentially the same function,
consisting of a main function which creates a class object and sends
this to a test function.  The class implementation can be linked as a
shared or archive library; the test function can be linked as a shared
library or at run time.  The dynamic cast fails in the combination
classes in archive library and run time dlopen, but nowhere else.

Version-Release number of selected component (if applicable):
gcc-3.2.3-20

How reproducible:
Always

Steps to Reproduce:
1.Unpack enclosed test case with "tar xfz testCast.tar.gz"
2.cd testCast
3.make
    

Actual Results:  ar_dlopen case fails.  All other succeeds.

Additional info:

FWIW, this also happens on Fedora Core 1 with gcc-3.3.2-1.

Comment 1 Göran Uddeborg 2003-11-19 16:25:55 UTC
Created attachment 96057 [details]
Test case referred to in the initial report

Comment 2 Jakub Jelinek 2003-11-20 00:28:41 UTC
If you want the ar_dlopen testcase to work, you need to link
it with -WL,--export-dynamic.


Note You need to log in before you can comment on or make changes to this bug.