Skip to content

Commit f802317

Browse files
committed
Merge from 'main' to 'sycl-web' (376 commits)
CONFLICT (content): Merge conflict in clang/lib/Basic/Targets/NVPTX.cpp
2 parents 8b0a2f7 + 0e8a414 commit f802317

File tree

1,299 files changed

+67862
-27879
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,299 files changed

+67862
-27879
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,9 +1277,12 @@ void RewriteInstance::createPLTBinaryFunction(uint64_t TargetAddress,
12771277

12781278
ErrorOr<BinarySection &> Section = BC->getSectionForAddress(EntryAddress);
12791279
assert(Section && "cannot get section for address");
1280-
BF = BC->createBinaryFunction(Rel->Symbol->getName().str() + "@PLT", *Section,
1281-
EntryAddress, 0, EntrySize,
1282-
Section->getAlignment());
1280+
if (!BF)
1281+
BF = BC->createBinaryFunction(Rel->Symbol->getName().str() + "@PLT",
1282+
*Section, EntryAddress, 0, EntrySize,
1283+
Section->getAlignment());
1284+
else
1285+
BF->addAlternativeName(Rel->Symbol->getName().str() + "@PLT");
12831286
setPLTSymbol(BF, Rel->Symbol->getName());
12841287
}
12851288

@@ -1411,15 +1414,19 @@ void RewriteInstance::disassemblePLT() {
14111414
continue;
14121415

14131416
analyzeOnePLTSection(Section, PLTSI->EntrySize);
1414-
// If we did not register any function at the start of the section,
1415-
// then it must be a general PLT entry. Add a function at the location.
1416-
if (BC->getBinaryFunctions().find(Section.getAddress()) ==
1417-
BC->getBinaryFunctions().end()) {
1418-
BinaryFunction *BF = BC->createBinaryFunction(
1417+
1418+
BinaryFunction *PltBF;
1419+
auto BFIter = BC->getBinaryFunctions().find(Section.getAddress());
1420+
if (BFIter != BC->getBinaryFunctions().end()) {
1421+
PltBF = &BFIter->second;
1422+
} else {
1423+
// If we did not register any function at the start of the section,
1424+
// then it must be a general PLT entry. Add a function at the location.
1425+
PltBF = BC->createBinaryFunction(
14191426
"__BOLT_PSEUDO_" + Section.getName().str(), Section,
14201427
Section.getAddress(), 0, PLTSI->EntrySize, Section.getAlignment());
1421-
BF->setPseudo(true);
14221428
}
1429+
PltBF->setPseudo(true);
14231430
}
14241431
}
14251432

0 commit comments

Comments
 (0)