[Development] Problem loading plugins with gcc 4.9.2

Sergio Martins sergio.martins at kdab.com
Wed Mar 4 12:22:14 CET 2015

On Tuesday, March 03, 2015 16:52:43 Thiago Macieira wrote:
> Since we're seeing both operator() and the innerFunction frames, I assume
> you compiled in debug mode. Correct?


> Anyway, I have GCC 4.9.2, Binutils 2.25.0 (using gold) and I cannot
> reproduce in either debug, regular release or LTO release modes. I have 8
> different global statics called "loader" in QtGui:
> $ nm -C libQt5Gui.so.5 | grep ::Q_QGS_loader::guard\$
> 00000000006a5750 b (anonymous namespace)::Q_QGS_loader::guard
> 00000000006a59c0 b (anonymous namespace)::Q_QGS_loader::guard
> 00000000006a5a20 b (anonymous namespace)::Q_QGS_loader::guard
> 00000000006a5ac0 b (anonymous namespace)::Q_QGS_loader::guard
> 00000000006a5b40 b (anonymous namespace)::Q_QGS_loader::guard
> 00000000006a61b0 b (anonymous namespace)::Q_QGS_loader::guard
> 00000000006a6200 b (anonymous namespace)::Q_QGS_loader::guard
> 00000000006a6374 b (anonymous namespace)::Q_QGS_loader::guard

I also have 8 loaders, but only 1 operator()() (actually 2, but with the same address), while on a good day I have 8 of these too.

Running nm on Albert's test-case shows:

gcc-4.9.2 $ nm gccbug  | c++filt  | grep operator
00000000004008ea W GlobalStatic<Bar, (anonymous namespace)::innerFunction()>::operator()()
00000000004008ea W GlobalStatic<Bar, (anonymous namespace)::innerFunction()>::operator()()

gcc-4.8.4 $ nm gccbug  | c++filt  | grep operator
00000000004008cc t GlobalStatic<Bar, (anonymous namespace)::innerFunction()>::operator()()
00000000004009a4 t GlobalStatic<Bar, (anonymous namespace)::innerFunction()>::operator()()

SĂ©rgio Martins | sergio.martins at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions

More information about the Development mailing list