[PATCH] D149525: [JITLink][RISCV] Only generate PLT entries for external symbols

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 00:44:15 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp:80
+    return (E.getKind() == R_RISCV_CALL || E.getKind() == R_RISCV_CALL_PLT) &&
+           E.getTarget().isExternal();
   }
----------------
jobnoorman wrote:
> StephenFan wrote:
> > MaskRay wrote:
> > > I don't know the object file model of jitlink, but adding a condition is definitely moving toward the right direction.
> > > 
> > > `isExternal` looks a bit strange. If the jitlink built object files are used as executables, `!isDefined()` should be a good enough proxy.
> > It seems `isExternal` can exclude absolute symbols.
> Indeed, so I would suggest to keep it like this.
An absolute symbol is defined in ELF. `isExternal` seems Mach-O specific and is not meaningful for ELF.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149525



More information about the llvm-commits mailing list