Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions llvm/lib/ExecutionEngine/Orc/Debugging/ELFDebugObjectPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ Error DebugObject::visitSectionLoadAddresses(GetLoadAddressFn Callback) {
if (Name->empty())
continue;
ExecutorAddr LoadAddress = Callback(*Name);
const_cast<SectionHeader &>(Header).sh_addr =
static_cast<typename ELFT::uint>(LoadAddress.getValue());
if (LoadAddress)
const_cast<SectionHeader &>(Header).sh_addr =
static_cast<typename ELFT::uint>(LoadAddress.getValue());
}

LLVM_DEBUG({
Expand Down Expand Up @@ -267,11 +268,16 @@ void ELFDebugObjectPlugin::modifyPassConfig(MaterializationResponsibility &MR,
// section headers in our debug object allocation
Error Err = DebugObj->visitSections(
[&G, &SectionsPatched, &HasDebugSections](StringRef Name) {
Section *S = G.findSectionByName(Name);
if (!S) {
// The section may have been merged into a different one during
// linking, ignore it.
return ExecutorAddr();
}

SectionsPatched += 1;
if (isDwarfSection(Name))
HasDebugSections = true;
Section *S = G.findSectionByName(Name);
assert(S && "No graph section for object section");
return SectionRange(*S).getStart();
});

Expand Down