Additionally, this uses a fast implementation to do the test, significantly reducing the amount of branching in this hot path of the relocation handling code.
Thanks to Joerg for suggesting this simple way to do this that should still retain most of the performance advantages of the approach in D27145.