Skip to content

Commit c31baef

Browse files
committed
prevent symbol reoslution in empty sections
1 parent 81e6acd commit c31baef

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,6 +2366,8 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
23662366
if (It->first != TargetSecAddr)
23672367
break;
23682368
TargetSectionSymbols.push_back(&AllSymbols[It->second]);
2369+
if (AllSymbols[It->second].empty())
2370+
TargetSecAddr = 0;
23692371
}
23702372
} else {
23712373
TargetSectionSymbols.push_back(&Symbols);
@@ -2478,15 +2480,6 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
24782480
} else if (LabelAvailable) {
24792481
*TargetOS << " <" << AllLabels[Target] << ">";
24802482
}
2481-
// else {
2482-
// this case is needed because the first load in the test assembly
2483-
// did not have any symbols in the section nor was it caught by any of
2484-
// else if cases. this warrented a case where the address is printed realtive
2485-
// to the target section. Since no symbol was found, there is no need to handle
2486-
// relocations
2487-
// *TargetOS << " <" <<
2488-
2489-
// }
24902483
// By convention, each record in the comment stream should be
24912484
// terminated.
24922485
if (TargetOS == &CommentStream)

0 commit comments

Comments
 (0)