This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GOLD] relocate() params
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 8 Dec 2015 14:52:27 -0800
- Subject: Re: [GOLD] relocate() params
- Authentication-results: sourceware.org; auth=none
- References: <20151125013517 dot GU8120 at bubble dot grove dot modra dot org> <CAJimCsGkYy0E70aoUHCP4N6ap1_CVjpt5zWXFNqWWVXjrcj1rg at mail dot gmail dot com> <20151208064214 dot GK1270 at bubble dot grove dot modra dot org> <20151208214536 dot GL1270 at bubble dot grove dot modra dot org>
> So this is how the relocate() reorganization looks.
>
> * object.h (struct Relocate_info): Add "rr".
> * reloc.h (Relocatable_relocs::set_strategy): New accessor.
> * reloc.cc (Sized_relobj_file::do_relocate_sections): Init
> relinfo.rr for relocate_section and relocate_relocs.
> * powerpc.cc (relocate): Add rel_type and preloc parameters.
> Delete rela and r_type params, instead recalculate these from
> preloc.
> (relocate_relocs): Delete Relocatable_relocs* param, instead
> use relinfo->rr.
> * aarch64.cc: Likewise.
> * arm.cc: Likewise.
> * i386.cc: Likewise.
> * mips.cc: Likewise.
> * s390.cc: Likewise.
> * sparc.cc: Likewise.
> * target.h: Likewise.
> * tilegx.cc: Likewise.
> * x86_64.cc: Likewise.
> * testsuite/testfile.cc: Likewise.
> * target-reloc.h (relocate_section): Adjust to suit.
> (apply_relocation, relocate_relocs): Likewise.
This looks good. In particular, I like how it cleans up the overloads
of Relocate::relocate() in the MIPS backend. We now have an extra
instantiation of the Rel/Rela accessor, but I'm pretty sure that's
zero cost in optimized code.
Thanks!
Sigh; my work-in-progress is not going to merge cleanly after this. I
should make you wait until I commit :-).
-cary