This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/3] bfd: DW_AT_high_pc can be relative to DW_AT_low_pc.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: binutils at sourceware dot org, Nick Clifton <nickc at redhat dot com>, "H.J. Lu" <hjl at lucon dot org>, Kazu Hirata <kazu at codesourcery dot com>, Fred Fish <fnf at specifix dot com>, Hans-Peter Nilsson <hp at axis dot com>, Richard Henderson <rth at redhat dot com>, Alan Modra <amodra at bigpond dot net dot au>
- Date: Fri, 27 Apr 2012 14:30:19 +0200
- Subject: Re: [PATCH 1/3] bfd: DW_AT_high_pc can be relative to DW_AT_low_pc.
- References: <1335528921-11582-1-git-send-email-mjw@redhat.com> <1335528921-11582-2-git-send-email-mjw@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Apr 27, 2012 at 02:15:19PM +0200, Mark Wielaard wrote:
> --- a/bfd/dwarf2.c
> +++ b/bfd/dwarf2.c
> @@ -2092,6 +2092,7 @@ scan_unit_for_symbols (struct comp_unit *unit)
> struct varinfo *var;
> bfd_vma low_pc = 0;
> bfd_vma high_pc = 0;
> + int high_pc_relative = 0;
Please use bfd_boolean high_pc_relative = FALSE; instead.
>
> abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
> info_ptr += bytes_read;
> @@ -2197,6 +2198,8 @@ scan_unit_for_symbols (struct comp_unit *unit)
>
> case DW_AT_high_pc:
> high_pc = attr.u.val;
> + if (attr.form != DW_FORM_addr)
> + high_pc_relative = 1;
And high_pc_relative = attr.form != DW_FORM_addr; here.
> @@ -2275,6 +2278,9 @@ scan_unit_for_symbols (struct comp_unit *unit)
> }
> }
>
> + if (high_pc_relative == 1)
> + high_pc += low_pc;
And just if (high_pc_relative) here.
Similarly elsewhere.
Ok for trunk with those changes, thanks.
Jakub