This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Support DW_AT_high_pc DWARF4 constant form
- From: Mark Wielaard <mjw at redhat dot com>
- To: binutils at sourceware dot org
- Cc: jakub at redhat dot com
- Date: Fri, 27 Apr 2012 14:15:18 +0200
- Subject: Support DW_AT_high_pc DWARF4 constant form
Hi,
The DWARF spec says (since version 4) that DW_AT_high_pc can be
represented by a constant form.
If the value of the DW_AT_high_pc is of class address, it is the
relocated address of the first location past the last
instruction associated with the entity; if it is of class
constant, the value is an unsigned integer offset which when
added to the low PC gives the address of the first location past
the last instruction associated with the entity.
I have a patch for gcc to encode DW_AT_high_pc this way (which saves a
lot of relocations) and jakub has a patch for dwz to encode
DW_AT_high_pc in the smallest possible constant form, which can save ~1%
on the size of debuginfo.
Here are three patches to make binutils handle this.
The first is for bfd dwarf2.c dwarf reader. Without this some testcases
fail when using a gcc that outputs this new form.
The second is for gas dwarf2dbg.c to output the new form for DWARF
version 4+. Though this isn't actually used in practice, since almost
everything still uses DWARF version 2, except for VMS in tc-ia64.h.
The patch does include two fixes for the ranges and line table output
which should not use the wrong version code. I did test that all
testcases do pass when explicitly setting DWARF2_VERSION to 4 now.
The last is for gold --gdb-index support. It includes a new testcase
that will fail when using a gcc that outputs the new form.
Patches in separate emails:
[PATCH 1/3] bfd: DW_AT_high_pc can be relative to DW_AT_low_pc.
[PATCH 2/3] gas: Make dwarf2dbg.c versions specific and add
[PATCH 3/3] gold: Handle DW_AT_high_pc as offset from DW_AT_low_pc
Thanks,
Mark