On Wed, Nov 19, 2008 at 09:32:10AM +0100, Daniel Veillard <[EMAIL PROTECTED]> 
wrote:
> On Sat, Nov 15, 2008 at 06:24:48PM +0100, Mike Hommey wrote:
> > Hi,
> > 
> > Have you considered using -Bsymbolic linker option instead of the
> > elfgcchack.h hack ?
> 
>   Hum, no ... I don't know -Bsymbolic, but I fail to see how the
> linker could solve the problem I tried to solve (bypass costly ELF
> lookup when doing internal library calls). Could you explain ?

My understanding of what elfgcchack.h tries to achieve is to remove
indirect calls (through the PLT) for function calls within the library.
-Bsymbolic just does that:

$ cat test.c
int foo(int a)
{
        return a;
}

int bar(void)
{
        return foo(0);
}
$ gcc -shared -fPIC -o test.so test.c
$ objdump -d test.so  |less
$ objdump -d test.so| grep foo
000003c8 <[EMAIL PROTECTED]>:
000004bc <foo>:
 4dd:   e8 e6 fe ff ff          call   3c8 <[EMAIL PROTECTED]>
$ gcc -Wl,-Bsymbolic -shared -fPIC -o test.so test.c
$ objdump -d test.so| grep foo
0000049c <foo>:
 4bd:   e8 da ff ff ff          call   49c <foo>

-Bsymbolic is supposed to do that for most symbols. -Bsymbolic-functions
is specialized to function calls.

Mike
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to