This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: --gc-section leftovers workaround.
On Wednesday 28 October 2009 19:23:11, Paul Pluzhnikov wrote:
> On Wed, Oct 28, 2009 at 11:51 AM, Pedro Alves <pedro@codesourcery.com> wrote:
>
> > With --gc-sections, gnu ld zeros out the start addresses of
> > unreferences FDEs, but leaves them behind.
>
> I believe the same thing happens when there are multiple instances of the
> same inline function in several translation units: one is selected, and
> debug info for the other ones gets zero start address.
Ah.
> The patch looks good to me.
It wasn't unfortunately. :-( I had posted an early patch
that got one thing wrong. It compared FDE->initial_location to
(FDE+1)->initial_location, to check for overlap, and discarded
FDE if so. But, this isn't correct since FDE may be the valid one
we should keep, and (FDE+1)->initial_location could be 0! The
corrected patch first looks for the first FDE with
initial_location != 0 and uses that one for overlap and discarding
decisions. Anyway, I think that patch is itself clearer than I
can manage to explain it. :-)
--
Pedro Alves