Skip to content

Commit 44e4155

Browse files
committed
[MachO] Treat a binary as containing Objective-C metadata if it has __objc_stubs
`__objc_stubs` is not technically Objective-C metadata, but binaries containing Objective-C stubs need the same processing. `MachoView` was previously only enabling the Objective-C workflow if it thinks there is type metadata. The same criteria was used to determine whether to process Objective-C metadata via `MachoObjCProcessor`. This meant binaries with `__objc_stubs` but no Objective-C type metadata were not running the Objective-C workflow, preventing stub functions from being inlined during analysis.
1 parent 6cb6714 commit 44e4155

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

view/macho/objc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ std::shared_ptr<ObjCReader> MachoObjCProcessor::GetReader()
8383

8484
bool MachoObjCProcessor::ViewHasObjCMetadata(BinaryView* data)
8585
{
86-
return (data->GetSectionByName("__objc_classlist") || data->GetSectionByName("__objc_catlist")
87-
|| data->GetSectionByName("__objc_protolist"));
86+
return data->GetSectionByName("__objc_classlist") || data->GetSectionByName("__objc_catlist")
87+
|| data->GetSectionByName("__objc_protolist") || data->GetSectionByName("__objc_stubs");
8888
}
8989

9090
MachoObjCProcessor::MachoObjCProcessor(BinaryView* data) :

0 commit comments

Comments
 (0)