[PATCH] D34138: [LLD][ELF] make default for get{ARM, AArch64}UndefinedRelativeWeakVA unreachable
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 14 10:38:01 PDT 2017
ruiu added inline comments.
================
Comment at: ELF/InputSection.cpp:405-406
switch (Type) {
+ // Unresolved branch relocations to weak references resolve to next
+ // instruction.
case R_ARM_THM_JUMP11:
----------------
peter.smith wrote:
> ruiu wrote:
> > What does this comment explain?
> In the ARM ABI there is a general rule for handling pc-relative relocations. There is a further special case for the subset of pc-relative instructions that are also branch relocations. I wanted to explain why the branch relocations resolved to the address of the next instruction, but the other relocations did not.
>
> I'll update the comments to make this more explicit.
Thank you for adding the explanation.
So, does this comment explain `return P + 2 + A`? I'd move this after `case` instead of writing it before `case`.
================
Comment at: ELF/InputSection.cpp:425
return P + 5 + A;
- default:
+ // Unresolved non branch pc-relative relocations
+ // R_ARM_TARGET2 which can be resolved relatively is not present as it never
----------------
Move this after the last `case` too.
https://reviews.llvm.org/D34138
More information about the llvm-commits
mailing list