This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch 2/7] [gold] Modify dwarf reader to get size and endianness from the object instead of from the parameters.
- From: Ian Lance Taylor <iant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 18 Oct 2012 11:35:22 -0700
- Subject: Re: [patch 2/7] [gold] Modify dwarf reader to get size and endianness from the object instead of from the parameters.
- References: <20121018181643.891AEE0AA0@ccoutant.mtv.corp.google.com>
On Thu, Oct 18, 2012 at 11:16 AM, Cary Coutant <ccoutant@google.com> wrote:
> This patch modifies the dwarf reader to get size and endianness from
> the Relobj object instead of from the global parameters (which requires
> an initialized target).
>
> gold/
> * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
> from object, not parameters.
> (Dwarf_info_reader::parse): Likewise.
> * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
> (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
> (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
> methods.
I don't quite understand how this works. You're changing
make_elf_reloc_mapper to take a Relobj. But it is called from
Dwarf_info_reader::do_parse passing this->object_, and
Dwarf_info_reader::object_ is an Object, not a relobj. It's clearly
important that Dwarf_info_reader continue to work for Dynobj as well
as Relobj. That's not a major issue as a Dynobj presumably doesn't
need a reloc mapper. But it seems that something is missing somewhere
here.
Ian