This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Hidden PLT workaround
On Fri, May 7, 2010 at 12:44 AM, Boris Arnoux <boris.arnoux@gmail.com> wrote:
>
> Hello,
>
> ÂI need the functionality of the glibc configure build option
> -disable-hidden-pltÂ(for example, to be able to override write under
> printf ).
>
> ÂUsing that build option, the build crashes, and according to the bug
> reports I saw, Âthis option is not supported anymore. ( "Then don't
> use the option. ÂThis is why the Makefile rules are what they are." --
> Ulrich Drepper ).
>
> ÂÂI find this option very interesting and powerful, and wanted to find
> a way to make some symbols overridable anyway.
>
> ÂSince include/libc-symbols.h is included via command line, my first
> attempt was to replace the "hidden" string by a macro, and then change
> the value of the macro Âin some parts of the source code.
>
> For example, to "default" around the "write" hidden_proto macro in
> unistd.h. That way the visibility of the internal "write" symbol is
> changed from hidden to default.ÂÂThis approach works well with uclibc
> for example, and it makes it easy to build a library with overridable
> symbols. But it does not work in glibc. I don't clearly understand
> why. Is there another thing making calls to these symbols not go
> through the PLT , such as an Âsymbol export map, or something like
> that ?
>
> ÂThanks!
> ÂBoris Arnoux
Boris,
Yes, you are close. There are Versions files which are combined
during the build stage to create linker scripts which indicate which
symbols are exported. Take a look at those.
Ryan