Bug 110438 - dynamic_cast fails depending on linking combination
dynamic_cast fails depending on linking combination
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2003-11-19 11:22 EST by Göran Uddeborg
Modified: 2007-11-30 17:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-11-19 19:28:41 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Göran Uddeborg 2003-11-19 11:22:36 EST
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):

How reproducible:

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

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 11:25:55 EST
Created attachment 96057 [details]
Test case referred to in the initial report
Comment 2 Jakub Jelinek 2003-11-19 19:28:41 EST
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.