Odd behavior with symbol naming mismatch between x86 and bfin platforms using version scripts
Ian Lance Taylor
iant@google.com
Mon Feb 8 17:45:00 GMT 2010
"Kevin P. Fleming" <kpfleming@digium.com> writes:
> One of our developers is running into an issue with version scripts not
> seeing symbols with the same naming scheme when code is built using GCC
> on an x86 platform vs. using the Blackfin tools (versions listed below).
> The attached files demonstrate the problem; when run as:
>
> $ CC=cc CFLAG="-fPIC" ./mk
>
> everything works as expected.
>
> when run as:
>
> $ CC=bfin-linux-uclibc-gcc CFLAG="-mfdpic " ./mk
>
> the test fails, because the 'testcallback' function appears in the
> dynamic symbol table as '_testcallback', and this the version script
> causes it to be filtered out.
>
> For x86 builds, we are using:
>
>> gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1
>> GNU ld (GNU Binutils for Ubuntu) 2.20
>
> For Blackfin builds:
>
>> bfin-linux-uclibc-gcc (ADI/svn-3473) 4.3.3
>> GNU ld version 2.17
>
> Is this a compiler bug, or a linker bug, or expected behavior?
I think this counts as painful but expected behaviour.
One could imagine adding extern "C" along the lines of extern "C++" to
remove the leading underscore on targets which use one. Or one could
imagine doing that automatically, although that would not be a
backward compatible change.
Ian
More information about the Binutils
mailing list