bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/3713] New: Dynamic-list-cpp-typeinfo doesn't handle correctly st


From: glazzara at gmail dot com
Subject: [Bug ld/3713] New: Dynamic-list-cpp-typeinfo doesn't handle correctly static variables in a class
Date: 13 Dec 2006 12:00:34 -0000

I have the following:
- A library called toto.so where the object Toto is implemented:

class Toto
{
        public:
                Toto();
                static Toto *instance() { return self; }

        private:
                static Toto *self;
};

- A main.cpp linked against toto.so:
int main()
{
    Toto tmp;
    std::cout << "Main: Toto::instance() == " << tmp.instance() << std::endl;
    return 0;
}

If I build everything like this:
g++ -shared -fPIC -Wl,--dynamic-list-cpp-typeinfo toto.cpp -o libtoto.so
g++ -Wl,--dynamic-list-cpp-typeinfo main.cpp -L. -ltoto

The toto::instance() function returns 0 in the main function.

However, if I build without --dynamic-list-cpp-typeinfo, the toto::instance()
function returns the correct value.

I compiled natively on Linux I386 and I cross compiled for ARM. 
I got the same results on both architectures.

-- 
           Summary: Dynamic-list-cpp-typeinfo doesn't handle correctly
                    static variables in a class
           Product: binutils
           Version: 2.17
            Status: NEW
          Severity: critical
          Priority: P1
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: glazzara at gmail dot com
                CC: bug-binutils at gnu dot org
GCC target triplet: Any


http://sourceware.org/bugzilla/show_bug.cgi?id=3713

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]