c++/8360: HP-UX gcc 3.2 does not construct global/static objects when using 'shl_load'

george.benavides@calebtech.com george.benavides@calebtech.com
Fri Oct 25 13:35:00 GMT 2002


>Number:         8360
>Category:       c++
>Synopsis:       HP-UX gcc 3.2 does not construct global/static objects when using 'shl_load'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 25 13:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     george.benavides@calebtech.com
>Release:        gcc 3.2 on HP-UX
>Organization:
>Environment:
HP-UX 11.0
>Description:
A problem exists where global/static objects are not getting constructed in a shared library that is dynamically loaded using HP 'shl_load' interface. If the library is linked during compile time, the objects are constructed without problem.
The shared library and executable are both compiled using g++ 3.2. Here are the commands used to build,which are provided in a Makefile:

        g++ -fPIC -c test_shared.cpp -o test_shared.o
        g++ -shared -fPIC test_shared.o -o libtestsh.sl
        g++ -fPIC -lpthread -ldld -L. test.cpp -o test

This problem seems to be related to HP-UX specific. The testcase provided works on Linux without errors.

Please advise.
>How-To-Repeat:
use testcase on a HP-UX 11.0 system
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list