-Bsymbolic-functions breaks PMF comparison under ARM

Giuseppe D'Angelo giuseppe.dangelo@kdab.com
Thu Jan 9 23:46:00 GMT 2014


Hello,

the attached program changes the output from "true" to "false" when the 
-Bsymbolic / -Bsymbolic-functions options are passed to GCC. This 
happens on ARM -- on x86-64 output is always "true".

The program involves a comparison, within a shared library, of a PMF 
defined inside the shared library itself with the same PMF passed by the 
application.

At this stage I still don't know if it's a GCC problem, a ld.so problem, 
ABI constraints, undefined behaviour, or whatnot; but any help is 
appreciated.

Compile with:

> g++ -fPIC -shared -Wall -o libshared.so -Wl,-Bsymbolic shared.cpp
> g++ -fPIE -Wall -o main main.cpp -L. -lshared

(The long story is that Qt 5 is taking PMFs in its public API, and the 
comparison failing inside of Qt shared libraries is breaking code on 
ARM, as -Bsymbolic is set by default there.)

Thanks,
-- 
Giuseppe D'Angelo | giuseppe.dangelo@kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 260 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20140109/a4b0a03f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shared.cpp
Type: text/x-c++src
Size: 405 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20140109/a4b0a03f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shared.h
Type: text/x-chdr
Size: 173 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20140109/a4b0a03f/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4048 bytes
Desc: Firma crittografica S/MIME
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20140109/a4b0a03f/attachment.p7s>


More information about the Gcc-help mailing list