This patch mainly extracts overflow checks for AArch64 relocations into a separate function.
In addition, it corrects checks for R_AARCH64_PREL16 and R_AARCH64_PREL32 relocations.
Differential D14922
[ELF/AArch64] Factor out overflow check into a separate function. ikudrin on Nov 23 2015, 5:58 AM. Authored by
Details This patch mainly extracts overflow checks for AArch64 relocations into a separate function. In addition, it corrects checks for R_AARCH64_PREL16 and R_AARCH64_PREL32 relocations.
Diff Detail Event TimelineComment Actions This, in principle, seems reasonable. I wonder if we can extend the check also to other targets (e.g. x86_64), but maybe that can be done later.
Comment Actions I'm not in favor of this change, and I wouldn't do that. The previous code was super clear that it errors if isInt check fails. Now you have to take a look at the definition of checkAArch64OutOfRange function. You saved one line per a function call, but it doesn't seem like a good tradeoff from code readability point of view. |
This and PREL16 fix bugs (changing the argument of check from SA to SA - P). I'd commit that separately, because it's a functional change.