[patch 2/7] [gold] Modify dwarf reader to get size and endianness from the object instead of from the parameters.

Ian Lance Taylor iant@google.com
Thu Oct 18 18:35:00 GMT 2012


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



More information about the Binutils mailing list