Blackfin and version scripts

Kurt Roeckx kurt at roeckx.be
Tue Jul 6 18:34:13 CEST 2010


On Mon, Jul 05, 2010 at 04:08:47PM -0400, Mike Frysinger wrote:
> On Mon, Jul 5, 2010 at 12:50, Kurt Roeckx wrote:
> > On Mon, Jul 05, 2010 at 03:43:21AM -0400, Mike Frysinger wrote:
> >> On Saturday, July 03, 2010 05:48:13 Kurt Roeckx wrote:
> >> > On Tue, Jun 22, 2010 at 11:42:43AM +0200, Werner Koch wrote:
> >> > > Hi!
> >> > >
> >> > >   GCRYPT_1.2 {
> >> > >
> >> > >     global:
> >> > >       gcry_check_version; gcry_control;
> >> > >
> >> > >   [...]
> >> > >
> >> > > Blackfin seems to be the only platform which has version script support
> >> > > and prefixes symbols with underscores.  That does not work of course.
> >> >
> >> > blackfins is one of the arches that defined underscores in the
> >> > ABI.  But I don't think an application writer should care about
> >> > that, and that this is a bug in binutils.
> >>
> >> no, it isnt.  please read the whole thread and the linker documentation.
> >
> > I'm not sure which part of the thread you think I missed that said
> > anything about it.  Most of it is actually about complelty
> > unrelated issues that have nothing to do with bfin.
> >
> > The only mail that seems to be about it is Ralf's mail about the
> > mangling.  But I'm not convinced that libtool should do any
> > mangle/demangle thing.  Atleast the gnu linker will already do the
> > proper thing for you, but some others might not.
> >
> > If you think I missed something, please point me to the actual
> > mail or documentation.
> 
> you stated "it is a bug in binutils".  that is simply wrong.  the
> linker script deals in *linker visible* symbols while C code deals in
> *C visible*.  it has always been this way and as you indirectly
> stated, this is not Blackfin specific.

We're talking about a version script, not a linker script.

But my point is that a version script is nothing arch specific,
unlike a linker script.  Version scripts even support saying in
which language the symbol is, so that it can properly mangle it
for you.  Adding the symbol inside an 'extern "C"' also doesn't
have any effect.

If you use a debugger, you also want to use "break main", and that
actually works, even if the symbol is really called _main in the
file.  You don't want to do "break _main" just because the
platform's ABI says that's the way symbols are named.


Kurt




More information about the Gcrypt-devel mailing list