Re: [xml] How to compile libxml2 gcc with -g and O option





-Regards
VijayKumar Manchala

Hi ,
 
am a new bie to this group,  am thankful for this group for libXml2 library.
 
I want to compile the source code with gcc -g and -O option,
 
please let me know where I have to change......
 
 
-Regards
  rahul.
 
 
 

--- On Wed, 19/11/08, Mike Hommey <mh glandium org> wrote:
From: Mike Hommey <mh glandium org>
Subject: Re: [xml] elfgcchack.h vs -Bsymbolic
To: "Daniel Veillard" <veillard redhat com>
Cc: xml gnome org
Date: Wednesday, 19 November, 2008, 3:16 PM

On Wed, Nov 19, 2008 at 09:32:10AM +0100, Daniel Veillard
<veillard redhat com> 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 <foo plt>:
000004bc <foo>:
 4dd:   e8 e6 fe ff ff          call   3c8 <foo plt>
$ 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/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


Download prohibited? No problem. CHAT from any browser, without download.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]