@@ -64,7 +64,8 @@ class ELFJITLinker_systemz : public JITLinker<ELFJITLinker_systemz> {
6464 auto DefineExternalGOTSymbolIfPresent =
6565 createDefineExternalSectionStartAndEndSymbolsPass (
6666 [&](LinkGraph &LG, Symbol &Sym) -> SectionRangeSymbolDesc {
67- if (Sym.getName () == ELFGOTSymbolName)
67+ if (Sym.getName () != nullptr &&
68+ *Sym.getName () == ELFGOTSymbolName)
6869 if (auto *GOTSection = G.findSectionByName (
6970 systemz::GOTTableManager::getSectionName ())) {
7071 GOTSymbol = &Sym;
@@ -90,7 +91,7 @@ class ELFJITLinker_systemz : public JITLinker<ELFJITLinker_systemz> {
9091
9192 // Check for an existing defined symbol.
9293 for (auto *Sym : GOTSection->symbols ())
93- if (Sym->getName () == ELFGOTSymbolName) {
94+ if (Sym->getName () != nullptr && *Sym-> getName () == ELFGOTSymbolName) {
9495 GOTSymbol = Sym;
9596 return Error::success ();
9697 }
@@ -112,7 +113,7 @@ class ELFJITLinker_systemz : public JITLinker<ELFJITLinker_systemz> {
112113 // we just need to point the GOT symbol at some address in this graph.
113114 if (!GOTSymbol) {
114115 for (auto *Sym : G.external_symbols ()) {
115- if (Sym->getName () == ELFGOTSymbolName) {
116+ if (Sym->getName () != nullptr && *Sym-> getName () == ELFGOTSymbolName) {
116117 auto Blocks = G.blocks ();
117118 if (!Blocks.empty ()) {
118119 G.makeAbsolute (*Sym, (*Blocks.begin ())->getAddress ());
@@ -365,14 +366,16 @@ class ELFLinkGraphBuilder_systemz
365366
366367public:
367368 ELFLinkGraphBuilder_systemz (StringRef FileName,
368- const object::ELFFile<ELFT> &Obj, Triple TT,
369- SubtargetFeatures Features)
370- : ELFLinkGraphBuilder<ELFT>(Obj, std::move(TT), std::move(Features),
371- FileName, systemz::getEdgeKindName) {}
369+ const object::ELFFile<ELFT> &Obj,
370+ std::shared_ptr<orc::SymbolStringPool> SSP,
371+ Triple TT, SubtargetFeatures Features)
372+ : ELFLinkGraphBuilder<ELFT>(Obj, std::move(SSP), std::move(TT),
373+ std::move (Features), FileName,
374+ systemz::getEdgeKindName) {}
372375};
373376
374- Expected<std::unique_ptr<LinkGraph>>
375- createLinkGraphFromELFObject_systemz ( MemoryBufferRef ObjectBuffer) {
377+ Expected<std::unique_ptr<LinkGraph>> createLinkGraphFromELFObject_systemz (
378+ MemoryBufferRef ObjectBuffer, std::shared_ptr<orc::SymbolStringPool> SSP ) {
376379 LLVM_DEBUG ({
377380 dbgs () << " Building jitlink graph for new input "
378381 << ObjectBuffer.getBufferIdentifier () << " ...\n " ;
@@ -391,7 +394,7 @@ createLinkGraphFromELFObject_systemz(MemoryBufferRef ObjectBuffer) {
391394
392395 auto &ELFObjFile = cast<object::ELFObjectFile<object::ELF64BE>>(**ELFObj);
393396 return ELFLinkGraphBuilder_systemz (
394- (*ELFObj)->getFileName (), ELFObjFile.getELFFile (),
397+ (*ELFObj)->getFileName (), ELFObjFile.getELFFile (), std::move (SSP),
395398 (*ELFObj)->makeTriple (), std::move (*Features))
396399 .buildGraph ();
397400}
0 commit comments