Hidden PLT workaround
Ryan Arnold
ryan.arnold@gmail.com
Fri May 7 13:32:00 GMT 2010
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
More information about the Libc-help
mailing list