This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Odd behavior with symbol naming mismatch between x86 and bfin platforms using version scripts
- From: Ian Lance Taylor <iant at google dot com>
- To: "Kevin P. Fleming" <kpfleming at digium dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 08 Feb 2010 09:44:54 -0800
- Subject: Re: Odd behavior with symbol naming mismatch between x86 and bfin platforms using version scripts
- References: <4B70434A.5090904@digium.com>
"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