This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix linkonce support with debug
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 13 Jun 2003 13:30:27 -0400
- Subject: Re: PATCH: Fix linkonce support with debug
- References: <20030613103947.A24300@forte.austin.ibm.com> <200306131640.MAA29696@makai.watson.ibm.com> <20030613122344.A24578@forte.austin.ibm.com> <20030613172450.GA5127@lucon.org>
On Fri, Jun 13, 2003 at 10:24:50AM -0700, H. J. Lu wrote:
> On Fri, Jun 13, 2003 at 02:26:32PM +0930, Alan Modra wrote:
> > On Thu, Jun 12, 2003 at 01:01:27PM -0700, H. J. Lu wrote:
> > > Alan,
> > >
> > > I believe your change mentioned in
> > >
> > > http://sources.redhat.com/ml/binutils/2001-09/msg00499.html
> > >
> > > breaks linkonce support with debug:
> > >
> > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7671
> >
> > I doubt that changing section ordering has anything to do with this
> > problem. The real problem is that we have debug info for a removed
> > section, with relocations that are left dangling. The debug info
> > ought to be removed along with the section, preferably by using
> > section groups.
> >
>
> This patch seems to work for me. We should try to preserve debug
> information discarded by linkonce as much as we can. It may not be
> ideal. But it is better than the current one.
No, I believe it is worse.
Consider that you now have multiple sections in .debug_info covering
the same PC range - not necessarily all identical.
Also consider what happens if the multiple copies of the linkonce
function are compiled with (say) different optimization levels. You
will have added a lot of line information which is completely bogus.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer