[PATCH] D149525: [JITLink][RISCV] Only generate PLT entries for external symbols
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 2 15:27:38 PDT 2023
MaskRay added inline comments.
================
Comment at: llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp:74
assert(E.getKind() == R_RISCV_CALL_PLT && "Not a R_RISCV_CALL_PLT edge?");
E.setKind(R_RISCV_CALL);
E.setTarget(PLTStubs);
----------------
Use `R_RISCV_CALL_PLT`?
================
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();
}
----------------
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.
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