[PATCH] D57940: Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 18:16:19 PDT 2019


MaskRay added a comment.

In D57940#1437293 <https://reviews.llvm.org/D57940#1437293>, @ruiu wrote:

> I thought that I sent it before, but it's gone somewhere...
>
> I wonder why you had to use template. Looks like you could just pass a plain function pointer. Is there any reason you didn't do that?


The reason I use `template <class RelTy> struct RelocationResolver` and make its partial specialization `template <class ELFT> struct RelocationResolver<Elf_Rel_Impl<ELFT, false>>` is because there are 4 `ELFT` types and each has the Rel variant and the Rela variant. If I de-template the struct, I'll have to define 8 functions.


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57940/new/

https://reviews.llvm.org/D57940





More information about the llvm-commits mailing list