-Bsymbolic breaks PMF comparison under ARM

Will Newton will.newton at linaro.org
Fri Jan 10 14:50:48 UTC 2014

On 10 January 2014 08:32, Giuseppe D'Angelo <giuseppe.dangelo at kdab.com> wrote:

Hi Guiseppe,

> 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 for the report and testcase.

The attached patch to ld may help. I am not yet sure whether or not it
is the correct approach but if it works for you that would be

Will Newton
Toolchain Working Group, Linaro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-bfd-elf32-arm.c-Set-st_value-to-zero-for-undefined-s.patch
Type: text/x-patch
Size: 2415 bytes
Desc: not available
URL: <http://lists.linaro.org/pipermail/linaro-toolchain/attachments/20140110/6d45b04e/attachment.bin>

More information about the linaro-toolchain mailing list