This is the mail archive of the
mailing list for the binutils project.
Re: [gold patch] Incremental 9/18: Apply incremental relocations
- From: Cary Coutant <ccoutant at google dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 20 Apr 2011 18:48:29 -0700
- Subject: Re: [gold patch] Incremental 9/18: Apply incremental relocations
- References: <BANLkTim4rnXeambJtP+zQWO8OEm0oMEO=Q@mail.gmail.com> <firstname.lastname@example.org>
> I don't see why this should be a target virtual function. ?It seems that
> the above could be templatized <int sh_type, int size, bool big_endian>
> and work for any target. ?That templatized function could go in
> target-relocs.h and be called from do_apply_incremental_relocs.
Hmmm. It needs to be templatized on typename Relocate as well:
relocate.relocate(relinfo, this, NULL, -1U, rel, r_type, sym, &symval,
view + r_offset, address + r_offset, view_size);
Then I'd still need a one-line Target_x86_64::apply_relocation() to
call the new function while supplying Target_x86_64::Relocate as the
template parameter, wouldn't I? (It would look just like
Target_x86_64::relocate_section.) I'd be able to abstract a dozen
lines or so out of it and into generic code in target-reloc.h, but I
don't see how to avoid adding the new target virtual function.
I was looking for a way to coalesce relocate_section and
apply_relocation, but that direction looked intrusive and involved
touching all targets at the same time.