This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: Re: Re: Does -gc-section (garbage collection) works only with static linking ?
- From: "Dave Korn" <dk at artimi dot com>
- To: "'Valery Pykhtin'" <pykhtin at prosoft dot ural dot ru>,"'Nick Clifton'" <nickc at redhat dot com>
- Cc: "'binutils'" <binutils at sources dot redhat dot com>
- Date: Wed, 8 Sep 2004 12:06:53 +0100
- Subject: RE: Re: Re: Does -gc-section (garbage collection) works only with static linking ?
> -----Original Message-----
> From: binutils-owner On Behalf Of Valery Pykhtin
> Sent: 08 September 2004 09:55
> Sorry if I bother you, but how this situation differs from
> the static link
> case ? Would the linker remove such function with static linking ?
>
> (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.
cheers,
DaveK
--
Can't think of a witty .sigline today....