Skip to content

Commit 65815a4

Browse files
committed
Add explanatory comment about relation between FoundFns and SymbolList addresses
1 parent 6201874 commit 65815a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/tools/llvm-nm/llvm-nm.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,11 @@ static void dumpSymbolsFromDLInfoMachO(MachOObjectFile &MachO,
16161616
}
16171617
// See if these addresses are already in the symbol table.
16181618
unsigned FunctionStartsAdded = 0;
1619+
// The addresses from FoundFns come from LC_FUNCTION_STARTS. Its contents
1620+
// are delta encoded addresses from the start of __TEXT, ending when zero
1621+
// is found. Because of this, the addresses should be unique, and even if
1622+
// we create fake entries on SymbolList in the second loop, SymbolAddresses
1623+
// should not need to be updated there.
16191624
SmallSet<uint64_t, 32> SymbolAddresses;
16201625
for (const auto &S : SymbolList)
16211626
SymbolAddresses.insert(S.Address);

0 commit comments

Comments
 (0)