[PATCH] D73254: [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 01:24:00 PST 2020


grimar added inline comments.


================
Comment at: lld/ELF/AArch64ErrataFix.cpp:424
   uint64_t p = patchSym->getVA() + 4;
-  target->relocateOne(buf + 4, R_AARCH64_JUMP26, s - p);
+  target->relocateWithoutSym(buf + 4, R_AARCH64_JUMP26, s - p);
 }
----------------
Is `relocateNoSym` sounds better?


================
Comment at: lld/ELF/Target.h:88
+  void relocateWithoutSym(uint8_t *loc, RelType type, uint64_t val) const {
+    Relocation rel{};
+    rel.type = type;
----------------
This creates an `R_ABS` relocation, what is probably not ideal.

What do you think about the following?
```
  void relocateWithoutSym(uint8_t *loc, RelType type, uint64_t val) const {
    relocate(loc, {R_NONE, type, 0, 0, nullptr}, val);
  }
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73254/new/

https://reviews.llvm.org/D73254





More information about the llvm-commits mailing list