[PATCH] ldso: auto disable lazy relocation for some fdpic ports when using threads
Andrew Stubbs
ams at codesourcery.com
Tue Feb 22 17:40:08 UTC 2011
On 22/02/11 17:06, Joseph S. Myers wrote:
> On Mon, 21 Feb 2011, Mike Frysinger wrote:
>
>> > The fdpic code requires two 32bit values to be read/written atomically
>> > (one pointer for the GOT and one for the PLT). FRV has an insn to do
>> > this sort of thing, but Blackfin does not. So in order to use FDPIC on
>> > a threaded system, we need to disable lazy relocation.
> This is what the SH FDPIC ABI has to say on this subject. I'm not sure
> what was needed in the resolver to implement it (though when I wrote the
> ABI we convinced ourselves it was implementable).
Right, the resolver makes sure that it does not make any assumptions
about the FDPIC value passed in.
It compares the value given with the load-map, and if it falls outside
the address range for the proper module, it walks the module list, and
finds the correct one.
The patches were never posted to uClibc because the GCC patches were not
accepted. At the time, there were also problems with upstream uClibc not
building for MMU-less targets. I've since moved to other projects, and
haven't had time to finish the upstream submission. :(
It's also possible that the code is subtly broken - race conditions are
not easy to detect, and our test hardware doesn't really have enough
memory to do much multitasking. However, various 3rd parties are using
it and have not reported any problems.
I can provide the work-in-progress patches for reference, if you wish,
or you could look at the sources for Sourcery G++ Lite for SH uClinux
here: http://www.codesourcery.com/sgpp/lite/superh
Andrew
More information about the uClibc
mailing list