[PATCH] D116475: [JITLink] Add anonymous symbols in LinkGraph for unnamed temporary symbols
luxufan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 1 07:12:34 PST 2022
StephenFan updated this revision to Diff 396858.
StephenFan added a comment.
Amend comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116475/new/
https://reviews.llvm.org/D116475
Files:
llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
Index: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
+++ llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
@@ -444,9 +444,17 @@
if (Sym.getType() == ELF::STT_SECTION)
*Name = GraphSec->getName();
+ // In RISCV, temporary symbols (Used to generate dwarf, eh_frame
+ // sections...) will appear in object code's symbol table, and LLVM does
+ // not use names on these temporary symbols (RISCV gnu toolchain uses
+ // names on these temporary symbols). If the symbol is unnamed, add
+ // anonymous symbols.
auto &GSym =
- G->addDefinedSymbol(*B, Sym.getValue(), *Name, Sym.st_size, L, S,
- Sym.getType() == ELF::STT_FUNC, false);
+ Name->empty()
+ ? G->addAnonymousSymbol(*B, Sym.getValue(), Sym.st_size,
+ Sym.getType() == ELF::STT_FUNC, false)
+ : G->addDefinedSymbol(*B, Sym.getValue(), *Name, Sym.st_size, L,
+ S, Sym.getType() == ELF::STT_FUNC, false);
setGraphSymbol(SymIndex, GSym);
}
} else if (Sym.isUndefined() && Sym.isExternal()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116475.396858.patch
Type: text/x-patch
Size: 1328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220101/3c83636e/attachment.bin>
More information about the llvm-commits
mailing list