gc-section

Alan Modra amodra@bigpond.net.au
Mon Mar 18 18:07:00 GMT 2002


On Mon, Mar 18, 2002 at 07:46:00PM -0500, Daniel Jacobowitz wrote:
> On Tue, Mar 19, 2002 at 10:55:21AM +1030, Alan Modra wrote:
> > > Is this 'drop' the only problem one will come across if one were to have GC
> > > work with shared libraries ?
> > 
> > You would also need to traverse all dynamic symbols the library
> > exports, and ensure that you don't drop their sections.  The library
> > itself may not reference all of it's symbols.
> 
> Is gc-sections even generally feasible in a dynamically linked binary? 

I think it's feasible with back-end support, but may not actually gain
much because of the implicit reference to exported symbols.  Hmm, a
dynamically linked application probably needs a pass over exported
symbols in the same manner as a shared lib will, to satisfy potential
references from shared libs back into the application.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list