Skip to content

Commit 5bf826b

Browse files
committed
[DSC] Reduce log noise when loading iOS / macOS 27 shared caches
These shared caches contain symbols pointing into address ranges that are no longer mapped, such as `objc_msgSend$stub` functions that are now merged into stub island regions.
1 parent 01ab3ad commit 5bf826b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

view/sharedcache/core/MachO.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,16 @@ std::vector<CacheSymbol> SharedCacheMachOHeader::ReadSymbolTable(VirtualMemory&
531531
{
532532
if (!flags.has_value())
533533
{
534-
// TODO: where logger?
535-
LogErrorF("Symbol {:?} at address {:#x} is not in any section", symbolName.c_str(), symbolAddress);
534+
// In iOS / macOS 27 shared caches, sections such as __objc_stubs are coalesced out of
535+
// individual dylibs, leaving a zero-size section whose symbols no longer point at
536+
// anything in this image. These are not an error.
537+
bool coalescedSection = nlist.n_sect > 0 && (size_t)(nlist.n_sect - 1) < sections.size()
538+
&& sections[nlist.n_sect - 1].size == 0;
539+
if (!coalescedSection)
540+
{
541+
// TODO: where logger?
542+
LogErrorF("Symbol {:?} at address {:#x} is not in any section", symbolName, symbolAddress);
543+
}
536544
continue;
537545
}
538546

0 commit comments

Comments
 (0)