[PATCH] D103001: [ELF][RISCV] Resolve branch relocations referencing undefined weak to current location if not using PLT

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 06:09:13 PDT 2021


jrtc27 accepted this revision.
jrtc27 added a comment.
This revision is now accepted and ready to land.

This isn't specified in the psABI, but I don't think it needs to be (AFAIK Arm's psABI is the only one that does, and it opts for the strange "next instruction" semantics, I guess so you can just skip the NULL check in some cases), it's completely undefined behaviour so should always be in dead code, but not known at compile time so we need to do something.



================
Comment at: lld/ELF/InputSection.cpp:793
+      else if (config->emachine == EM_RISCV)
+        dest = getRISCVUndefinedRelativeWeakVA(type, p) + a;
       else
----------------
MaskRay wrote:
> jrtc27 wrote:
> > Hm, this is a better way of writing it but it's inconsistent with ARM and AArch64.
> I can change arm/aarch64 to use this style afterward
That's fine with me then


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103001



More information about the llvm-commits mailing list