[gold patch] Incremental 9/18: Apply incremental relocations
Cary Coutant
ccoutant@google.com
Thu Apr 21 01:48:00 GMT 2011
> 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;
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.
-cary
More information about the Binutils
mailing list