bug-binutils
[Top][All Lists]
Advanced

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

Odd ld behaviour starting at version 2.22


From: Douglas Graham
Subject: Odd ld behaviour starting at version 2.22
Date: Thu, 30 Oct 2014 20:37:29 +0000

Hello,

I'm not actually sure that this is a linker bug, but it sure looks
like one.  Version 2.21.1a of ld works fine, but starting at version
2.22 and up to 2.24, we are seeing some odd behaviour that is hard to
pin down.  All versions of the linker were built and run on a x86_64
RHEL 6.4 system specifying only --prefix to configure. The symptoms vary,
but one symptom that seems to turn up a lot in many different unit tests
is that we have a hashmap

  typedef hash_map<OSTMOREF, TmoStruct> tmomap_t;
  tmomap_t TmoMap;

defined at file scope. In at least one of the unit tests that fail, nothing
is ever put into this hashmap, yet the shutdown loop iterates at least once:

                    for (tmomap_t::const_iterator it = TmoMap.begin(); it != 
TmoMap.end(); ++it)
                    {
                        if (it->second.state == FIRED) continue;

                        union SIGNAL* sig = it->second.tmosig;
                        if (sig) free_buf(&sig);
                    }

Here the symptoms seems to vary. Sometimes we get a crash when "it"
is dereferenced, and sometimes the call to free_buf() fails because it is
being passed garbage.

Our unit tests link against a number of shared libraries that were also
linked with the problematic linker.  It seems to be only one of those
libraries that is causing these problems (the one containing the TmoMap
definition above).   This library is linked like so:

 g++ \
    -pthread \
    -m32 \
    -Wa,--32 \
    -march=i686 \
    -fmessage-length=0 \
    -ggdb \
    -pthread \
    -lrt \
    -ldl \
    -Wl,-rpath=<repo>/test/unitTestFramework/lib/linux \
    -Wl,-rpath=<repo>/test/unitTestFramework/gmock/gmock-1.6.0/lib \
    -Wl,-rpath=<repo>/test/unitTest/lib \
    -L<...>/gcc_linux_sfk-linux_4.6.3/lib \
    -lstdc++ \
    -L<repo>/test/unitTest/lib \
    -L<repo>/test/unitTest/obj/testmain \
    -ltestmain \
    -L<repo>/test/unitTestFramework/gmock/gmock-1.6.0/lib \
    -lgtest \
    -lgmock \
    -fPIC \
    -shared \
    -lstdlibStub \
    -o <repo>/test/unitTest/lib/libosesimstub.so \
    <repo>/test/unitTest/obj/osesimstub/<repo>/test/stubs/ose/ose_sim.o \
    <repo>/test/unitTest/obj/osesimstub/<repo>/test/stubs/ose/tmosv_sim.o

Any ideas what might be going on here, or how to figure out where things
are going wrong?

Thanks,
Doug





reply via email to

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