This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Re: Re: Re: Does -gc-section (garbage collection) works only with static linking ?
- From: "Valery Pykhtin" <pykhtin at prosoft dot ural dot ru>
- To: "Dave Korn" <dk at artimi dot com>
- Cc: "binutils" <binutils at sources dot redhat dot com>
- Date: Wed, 8 Sep 2004 17:24:39 +0600
- Subject: Re: Re: Re: Re: Does -gc-section (garbage collection) works only with static linking ?
- References: <NUTMEG6pkNzPZrIkyPz00001229@NUTMEG.CAM.ARTIMI.COM>
Hi Dave,
Its getting more and more interesting :)
> > (i386 Intel syntax)
> >
> > mov eax,myfxptr
> > ...
> > call [eax] // in user's program
> >
> > Does GCC compiler tells the linker in this case that myfx is called ?
>
> The linker will find a reloc pointing at the "mov eax" instruction
above,
> and so can deduce that myfx is referred to and knows not to discard it.
So what is the problem with pointers to functions that are passed to
external dynamic library? The linker could still find these relocates and
consider not to discard these functions?
Best regards,
Valery