RFC: Change of dw2 DWARF_OFFSET_SIZE on 64-bit to POINTER_SIZE
Joseph S. Myers
joseph@codesourcery.com
Thu Aug 28 19:54:00 GMT 2008
On Tue, 26 Aug 2008, NightStrike wrote:
> On 8/1/08, Kai Tietz <Kai.Tietz@onevision.com> wrote:
> > Hello,
> >
> > The default value of DWARF_OFFSET_SIZE of 4 is for w64 a problem, because
> > on w64 there are only 64-bit imaged based relocations present and the
> > offset is build of this offset is computed by a secrel offset.
> > Additionally there is no way for this target to set VA to zero as done for
> > elf. I prepared a patch for binutils to change this behaviour. As we
> > discussed is the additional memory consume for 64-bit less, so I want to
> > query if there is general agreement in changing this value in general for
> > 64-bit targets?
> > These should affect DW_AT_stmt_list and the arange to use 8 byte offset
> > for 64-bit targets.
> >
> > The change would be in dwarf2out.c and looks like:
> > ....
> > /* The size in bytes of a DWARF field indicating an offset or length
> > relative to a debug info section, specified to be 4 bytes in the
> > DWARF-2 specification. The SGI/MIPS ABI defines it to be the same
> > as PTR_SIZE. */
> >
> > #ifndef DWARF_OFFSET_SIZE
> > -#define DWARF_OFFSET_SIZE 4
> > +#define DWARF_OFFSET_SIZE (TARGET_64BIT ? 8 : 4)
> > #endif...
> >
> > As I discussed with binutils, they would be happy to change this, if gcc
> > would change its behaviour, too.
>
> I haven't seen a response on this yet. Have I missed it?
Such a patch is obviously wrong; TARGET_64BIT is a target-specific macro
used in some particular targets and cannot be used in generic code. In
general 64-bit offsets are only needed if a single object has more than
4GB of debug info. So such a patch is a pessimization for almost all
normal code. Please see the text from the DWARF standard I quoted when
stopping MIPS64 GNU/Linux from using 64-bit offsets
<http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00142.html>.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc-patches
mailing list