This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gc sections and .eh_frame
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 25 Aug 2005 10:17:45 +0930
- Subject: Re: gc sections and .eh_frame
- References: <42A5DE0C.9050108@eCosCentric.com> <200506280940.28723.ebotcazou@adacore.com> <20050628114133.GC8706@bubble.grove.modra.org> <200506281357.59145.ebotcazou@adacore.com> <20050629012401.GD8706@bubble.grove.modra.org> <20050629135426.GD28975@bubble.grove.modra.org> <20050726112947.GF13611@bubble.grove.modra.org> <m3ek8iankv.fsf@alligator.red-bean.com>
On Wed, Aug 24, 2005 at 05:04:48PM -0700, Jim Blandy wrote:
> That is, normally, if the GC keeps some section A, and A has relocs
> referring to (symbols defined in) some section B, then the GC should
> also keep B. Conversely, if there are no kept sections with relocs
> referring to B, then B should be dropped.
Yes, and yes.
> For exception handling tables, however, the relocs point in the
> opposite direction: if the GC keeps some code section A, and some
> exception table B has relocs referring to A, then the GC should also
> keep B. Conversely, if there are no kept code sections that an
> exception table B has relocs referring to, then B should be dropped.
No. gc marking of sections referenced from .gcc_except_table* should be
as for any other section. If we had per-function .eh_frame sections
then there wouldn't be anything special at all about .eh_frame* and
.gcc_except_table*. ie. relocs in .eh_frame* would reference
.gcc_except_table*. The trouble is that we have a monolithic .eh_frame,
so we can't treat its relocs normally (and we can't break up .eh_frame
easily, but that's another story).
--
Alan Modra
IBM OzLabs - Linux Technology Centre