I have a test driver linked to a library I wrote. The library uses autotools so it produces both an archive (.a file) and a dynamic library (.so).
When I link my driver with 'g++ -static', presumably linking to the .a, valgrind lights up complaining repeatedly 'Conditional jump or move depends on uninitialised value(s)'. The first failure occurs before main in __pthread_initialize_minimal.
When I link without -static, presumably linking with the .so, I don't get any valgrind complaints.
Does anyone know why? Does valgrind just not work with -static?
UPDATE: I can't post even a pared down version of my driver because it links to a very large library that I couldn't possible pare down, but I notice that simplest of all programs
int main()
{
return 0;
}
gives an error when linked with -static and run from valgrind:
==15449== Use of uninitialised value of size 8
==15449== at 0x40B0F3: exit (in /home/jdgordo/src/t)
I should have included that I'm running on 64-bit Redhat 5.5.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…