[PATCH] D54474: [LLD][AArch64] Fix resolution of R_PLT_PAGE RelExpr

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 08:13:13 PST 2018


grimar added a comment.

It looks correct. Minor nits/suggestions.



================
Comment at: ELF/InputSection.cpp:683
       Dest = getAArch64Page(Sym.getVA(A));
     return Dest - getAArch64Page(P);
   }
----------------
Perhaps better to split them into the different 'case's then?
I would remove `Dest` and start doing early returns too.

May be something like the following?

```
case R_PAGE_PC:    
  uint64_t Val = Sym.isUndefWeak() ? A : Sym.getVA(A);
  return getAArch64Page(Val)  - getAArch64Page(P);

case R_PLT_PAGE_PC:
  uint64_t Val = Sym.isUndefWeak() ? A : (Sym.getVA(A) + A);
  return getAArch64Page(Val) - getAArch64Page(P);
```


================
Comment at: test/ELF/aarch64-gnu-ifunc3.s:6
+# RUN: llvm-readobj -r %tout | FileCheck %s --check-prefix=RELOC
+.text
+.globl myfunc
----------------
Please an empty line before `.text`


https://reviews.llvm.org/D54474





More information about the llvm-commits mailing list