Re: Debug info for comdat functions

2012-04-18 Thread Jakub Jelinek
On Wed, Apr 18, 2012 at 03:23:35PM +0200, Jakub Jelinek wrote: > > DW_TAG_GNU_call_site wants to refer to the called function's DIE, so > > the function die in the separate unit needs to have its own symbol. > > Perhaps _call_site could refer to the function symbol instead? That > > seems more cor

Re: Debug info for comdat functions

2012-04-18 Thread Jason Merrill
On 04/18/2012 07:40 PM, Cary Coutant wrote: Nice -- I've been wanting to do that for a while, but I always thought it would be a lot harder. I see that you've based this on the infrastructure created for -feliminate-dwarf2-dups. I don't think that will play nice with -fdebug-types-section, though

Re: Debug info for comdat functions

2012-04-18 Thread Cary Coutant
> This seems clearly wrong to me.  A reference to a symbol in a discarded > section should not resolve to an offset into a different section.  I thought > the linker always resolved such references to 0, and I think that is what we > want. Even resolving to 0 can cause problems. In the Gnu linker,

Re: Debug info for comdat functions

2012-04-18 Thread Jakub Jelinek
On Wed, Apr 18, 2012 at 08:43:37AM -0400, Jason Merrill wrote: > On 04/18/2012 07:53 AM, Jakub Jelinek wrote: > >Consider attached testcase with comdat foo function, seems the > >current linker behavior (well, tested with 2.21.53.0.1 ld.bfd) > >is that for DW_TAG_subprogram with DW_AT_low_pc/DW_AT_

Re: Debug info for comdat functions

2012-04-18 Thread Jason Merrill
On 04/18/2012 07:53 AM, Jakub Jelinek wrote: Consider attached testcase with comdat foo function, seems the current linker behavior (well, tested with 2.21.53.0.1 ld.bfd) is that for DW_TAG_subprogram with DW_AT_low_pc/DW_AT_high_pc having section relative relocs against comdat functions if the c

Re: Debug info for comdat functions

2012-04-18 Thread Jakub Jelinek
Hi! Sorry for following up to self, but something I forgot to add about this: On Wed, Apr 18, 2012 at 01:16:40PM +0200, Jakub Jelinek wrote: > Something not addressed yet in dwz and unfortunately without > linker or compiler help not 100% addressable is debug info for > comdat functions. When di