This is the mail archive of the
mailing list for the binutils project.
Odd ld behaviour starting at version 2.22
- From: Douglas Graham <douglas dot graham at ericsson dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 31 Oct 2014 20:57:59 +0000
- Subject: Odd ld behaviour starting at version 2.22
- Authentication-results: sourceware.org; auth=none
I sent this to firstname.lastname@example.org but I didn't see it turn up in the archives, so I'm not sure where it went.
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;
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:
-o <repo>/test/unitTest/lib/libosesimstub.so \
Any ideas what might be going on here, or how to figure out where things are going wrong?