PATCH: Fix linkonce support with debug

H. J. Lu hjl@lucon.org
Fri Jun 13 17:36:00 GMT 2003


On Fri, Jun 13, 2003 at 01:30:27PM -0400, Daniel Jacobowitz wrote:
> 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.

That is why I said it was not ideal.
>
> 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.
> 

Isn't is completely bogus in this situation today? We are picking
one from 2 bad choices. I don't think mine is any worse than the
current one.


H.J.



More information about the Binutils mailing list