Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Feb 2007 12:59:47 +0100
From:      Olivier Houchard <mlfbsd@ci0.org>
To:        Pascal Hofstee <caelian@gmail.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: __aeabi_read_tp missing symbol
Message-ID:  <20070227115947.GA17619@ci0.org>
In-Reply-To: <1172565447.1394.20.camel@chekov>
References:  <1172565447.1394.20.camel@chekov>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Pascal,


On Tue, Feb 27, 2007 at 09:37:27AM +0100, Pascal Hofstee wrote:
> Hi,
> 
> I just finished writing a small application for my job on FreeBSD/i386
> making sure everything compiles WARNS=9 clean. Now comes the task to
> move this code over to our embedded platform which is an Intel XScale
> (Linksys NSLU2) at the moment i have not been able to test out cognet@'s
> FreeBSD/arm work yet .. so we're using a Linux (Debian/Etch) to do our
> embedded development on, so i apologise if this tunrs out to be a Linux
> problem and i am asking the wrong people for assistence :)
> 
> The problem i am encountering is that during the link stage i get a lot
> of the following link errors:
> 
> datastream.o: In function `deleteSynchronisedData':
> ...../datastream.c:909: undefined reference to `__aeabi_read_tp'
> 

Yes it is definitively a linux problem :-)
See below.

> Googling so far has taught me that this is GCC's work and well the
> following:
> 
> `-mtp=NAME'
>       Specify the access model for the thread local storage pointer.
>       The valid models are `soft', which generates calls to
>       `__aeabi_read_tp', `cp15', which fetches the thread pointer from
>       `cp15' directly (supported in the arm6k architecture), and `auto',
>       which uses the best available method for the selected processor.
>       The default setting is `auto'.
> 
> Obviously GCC is of the opinion that it should use the "soft" access model for
> thread local storage (which i am indeed using a lot in this source file). But
> somehow the link stage fails to find these symbols.
> 
> Where should these symbols be coming from normally and how would i go about
> fixing my link stage ... It seems as if the compiler is of the opinion that
> TLS is supported.
> 
> Once again i know this is currently on a Linux platform but i have much bigger
> trust in the FreeBSD community to provide sensible answers in this regard.
> 

Latest revisions of gcc/binutils have support for TLS. And using EABI is the
right thing to do on linux. You're just using the wrong libc, eabi_read_tp and
friends come from the glibc. If changing your glibc is not an option, you'll
have to play with -mabi, and set it to something else than eabi, however if
you need TLS I think you're doomed with this version of gcc, you'll have to
find a matching glibc.

I could be wrong on this one, I'm not a linux/arm specialist.

Cheers,

Olivier


> -- 
>   Pascal Hofstee
> 
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070227115947.GA17619>