This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Change in dwarf2dbg using sizeof_offset


On Wed, Jul 30, 2008 at 12:19:15PM +0200, Kai Tietz wrote:
> Hello Alan,
> 
> Alan Modra <amodra@bigpond.net.au> wrote on 30.07.2008 10:29:23:
> 
> > On Tue, Jul 29, 2008 at 12:27:30PM +0200, Kai Tietz wrote:
> > > Hi,
> > > 
> > > has I noticed uses dwarf2dbg.c for TC_DWARF2_EMIT_OFFSET in some 
> places 
> > > the sizeof 4 bytes instead of sizeof_offset. This is a major problem 
> for 
> > > the w64 target, because section relative relocation have to be 64-bit 
> > > wide, and there is no useful 32-bit relocation, which could handle 
> this. I 
> > > would suggest to change those dw2 types, like DW_AT_stmt_list and the 
> > > arange to use sizeof_offset instead.
> > > Is this already a bug, or is this a major change? I saw already 
> comments 
> > > about this issue in source code, too.
> > 
> > I don't think either of these are bugs, but it is a little strange
> > that we don't use the 64-bit offsets for 64-bit targets since that
> > means we can't have a .debug_info section larger than 4G.
> > 
> > Now, if you change the DW_AT_stmt_list TC_DWARF2_EMIT_OFFSET then of
> > course you need to change out_debug_abbrev to emit the correct DW_FORM
> > for it.  That change should be painless, I think.
> > 
> > If you change the .debug_aranges TC_DWARF2_EMIT_OFFSET, then you need
> > to also output a 64-bit dwarf section length (0xffffffff followed by a
> > 64-bit length) for .debug_aranges, to notify consumers that the
> > section is 64-bit dwarf.  The current 32-bit section length used in
> > .debug_aranges says that .debug_aranges is always 32-bit dwarf, even
> > on a 64-bit target.
> > 
> > Does anyone see a reason why we shouldn't make these changes?
> 
> At the moment I do not warn about .secrel32 in 64-bit and do not disabled 
> it, because gcc tests for secrel32 to enable dw2 for mingw at the moment.
> 
> ChangeLog for gas
> 
> 2008-07-30  Kai Tietz  <kai.tietz@onevision.com>
> 
>         * config/tc-i386.c (md_pseudo_table): Add secrel64 symbol.
>         (pe_directive_secrel): Make use of argument to verify secrel size.
>         * dwarf2dbg.c (out_debug_aranges): Adjust to use 64-bit frame and 
> sizeof_offset.
>         (out_debug_abbrev): DW_AT_stmt_list use 64-bit dw2 frame.
>         (out_debug_info): Use sizeof_offset for TC_DWARF2_EMIT_OFFSET.
> 
> Is this patch ok for mainline?
> 

This is NOT OK without some testcases. I tend to agree with Daniel that
it is intentional.

Please find out how Linux/x86-64 deals with it.  You may need to
add some special relocations to support DWARF on w64 since MSC doesn't
have relocations for DWARF.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]