Skip to content

Commit 0423532

Browse files
author
anoopkg6
committed
Resolve issues with conflicts
1 parent 574a239 commit 0423532

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

llvm/include/llvm/ExecutionEngine/JITLink/ELF_systemz.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ namespace jitlink {
2525
/// Note: The graph does not take ownership of the underlying buffer, nor copy
2626
/// its contents. The caller is responsible for ensuring that the object buffer
2727
/// outlives the graph.
28-
Expected<std::unique_ptr<LinkGraph>>
29-
createLinkGraphFromELFObject_systemz(MemoryBufferRef ObjectBuffer);
28+
Expected<std::unique_ptr<LinkGraph>> createLinkGraphFromELFObject_systemz(
29+
MemoryBufferRef ObjectBuffer, std::shared_ptr<orc::SymbolStringPool> SSP);
3030

3131
/// jit-link the given object buffer, which must be a ELF systemz relocatable
3232
/// object file.

llvm/lib/ExecutionEngine/JITLink/ELF_systemz.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

366367
public:
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

Comments
 (0)