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
10 changes: 6 additions & 4 deletions llvm/tools/llvm-readobj/COFFDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,10 +645,11 @@ void COFFDumper::cacheRelocations() {
for (const SectionRef &S : Obj->sections()) {
const coff_section *Section = Obj->getCOFFSection(S);

append_range(RelocMap[Section], S.relocations());
auto &RM = RelocMap[Section];
append_range(RM, S.relocations());

// Sort relocations by address.
llvm::sort(RelocMap[Section], [](RelocationRef L, RelocationRef R) {
llvm::sort(RM, [](RelocationRef L, RelocationRef R) {
return L.getOffset() < R.getOffset();
});
}
Expand Down Expand Up @@ -1270,14 +1271,15 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
reportError(errorCodeToError(EC), Obj->getFileName());

W.printString("LinkageName", LinkageName);
if (FunctionLineTables.count(LinkageName) != 0) {
auto [It, Inserted] =
FunctionLineTables.try_emplace(LinkageName, Contents);
if (!Inserted) {
// Saw debug info for this function already?
reportError(errorCodeToError(object_error::parse_failed),
Obj->getFileName());
return;
}

FunctionLineTables[LinkageName] = Contents;
FunctionNames.push_back(LinkageName);
break;
}
Expand Down
Loading