This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch RFC: fix address size of DW_FORM_ref_addr
- From: "Ian Lance Taylor via binutils" <binutils at sourceware dot org>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 20 Nov 2017 13:02:35 -0800
- Subject: Re: gold patch RFC: fix address size of DW_FORM_ref_addr
- Authentication-results: sourceware.org; auth=none
- References: <CAKOQZ8yXwDzus0sex9zs+Nz58TZdKw8VfGEOo8FowqwHDwMsPQ@mail.gmail.com> <CAJimCsFEd+2ogeETvoTLpTZCu8sYy17KrnxvZbi-63Y=qbDuFQ@mail.gmail.com>
- Reply-to: Ian Lance Taylor <iant at google dot com>
On Sun, Nov 19, 2017 at 5:56 PM, Cary Coutant <ccoutant@gmail.com> wrote:
>> In DWARF version 3, DW_FORM_ref_addr changed from using the
>> compilation unit's address size to using the compilation unit's offset
>> size. Although that change happened a while ago, gold was never
>> updated. This patch updates gold.
>>
>> I'm not sure if there is a reasonable way to test this. GCC never
>> seems to generate DW_FORM_ref_addr anyhow; it uses DW_FORM_ref4. I
>> ran across this using the Go compiler, which does DW_FORM_ref_addr
>> although it should probably also use DW_FORM_ref4.
>>
>> Anyhow, Cary, does this patch look correct to you? Thanks.
>
> To be accurate: DWARF v3 predates gold, so it's not that gold wasn't
> updated, it's just that it was wrong in the first place.
>
> Yes, that looks correct, but I'd prefer to do it with a
> Dwarf_info_reader::ref_addr_size() method instead.
>
> Fix DWARF reader to use correct size for DW_FORM_ref_addr.
>
> 2017-11-19 Ian Lance Taylor <iant@google.com>
> Cary Coutant <ccoutant@gmail.com>
>
> gold/
> * gold/dwarf_reader.h (class Dwarf_info_reader): Add ref_addr_size
> method.
> * gold/dwarf_reader.cc (Dwarf_die::read_attributes): Use ref_addr_size
> for DW_FORM_ref_addr_size.
> (Dwarf_die::skip_attributes): Likewise.
>
> Committed.
>
> Thanks!
Thanks.
Ian