[reprise] PIC and flat shared library support for m68k
Richard Sandiford
richard at codesourcery.com
Wed Oct 25 08:20:24 UTC 2006
A while ago, I posted a patch that added full init/fini support
to shared flat libraries:
http://www.uclibc.org/lists/uclibc/2006-July/015892.html
One of the big caveats at the time was:
> - The patch adds new configuration options for building a shared libc.
> Unfortunately, this libc will not be usable as-is, because libc.gdb
> will export all global symbols, including those which are supposed
> to be local to the library.
>
> The traditional way of dealing with this has been to run a separate
> objcopy post-pass that uses -L to localise specific symbols by name
> (see the page linked above for details). However, I think a better
> approach is to localise every hidden symbol, and objcopy now has a
> --localize-hidden option to do just that:
>
> http://sources.redhat.com/ml/binutils/2006-06/msg00204.html
>
> This option isn't yet in any released binutils though (it'll be in 2.18).
>
> I'll soon submit a patch to uclinux-dev that (subject to
> configuration options) will make ld-elf2flt use --localize-hidden
> on shared libraries by default. I hope this might eventually become
> standard, so no post-processing step is necessary, either in the libc
> makefile, or in user makefiles.
>
> In other words, I've written the makefile so that it will work
> out-of-box with the patched ld-elf2flt, when configured appropriately,
> but so that the user will need a separate post-processing step otherwise.
> I don't know if that's acceptable.
That ld-elf2flt patch has now been committed. The committed version
also has a fallback if objcopy --localize-hidden isn't available,
so it isn't tied to any particular version of binutils.
Would the uClibc patch be acceptable now that the ld-elf2flt patch is in?
If so, I can refresh and retest it.
FWIW, Bernd expressed a Blackfin interest in the patch, but I don't
know if that still stands, or whether the Blackfin folks are
concentrating on ELF now.
Richard
More information about the uClibc
mailing list