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: gold patch RFC: fix address size of DW_FORM_ref_addr


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


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