Current relocation processing does:
if (the relocation expr belongs to category A) do something; if (the relocation expr belongs to category B) do something; if (the relocation expr belongs to category C) do something;
This refactor flattens it into
switch (expr) { case R_PC: case R_...: do something; case R_...: do something; ... }
which may potentially improve performance.
In addition, if some architectures have strange logic, we can add a new RelExpr member and make it interrupt less to the generic code.
Is it worth moving closer to the only caller processRelocAux. Perhaps worth emphasisng that this only handles relocations that are expected in processRelocaAux. Could do with a comment or perhaps renaming to something like customRelocIsStaticLinkTimeConstant
If there were a way to know if a particular expr code could be CUSTOM outside of scanReloc then we could assert that which would make it clear, but I'm not sure if there is an easily maintainable way to do that.