Skip to content

Commit

Permalink
[Mach-O] -ObjC should force-load any section starting with __swift
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Jul 6, 2022
1 parent 5d5f75c commit 5634b22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions macho/input-files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,9 @@ bool ObjectFile<E>::is_objc_object(Context<E> &ctx) {
for (std::unique_ptr<InputSection<E>> &isec : sections)
if (isec)
if (isec->hdr.match("__DATA", "__objc_catlist") ||
isec->hdr.match("__TEXT", "__swift"))
return true;
(isec->hdr.get_segname() == "__TEXT" &&
isec->hdr.get_sectname().starts_with("__swift")))
return true;

for (i64 i = 0; i < this->syms.size(); i++)
if (!mach_syms[i].is_undef() && mach_syms[i].is_extern &&
Expand Down

0 comments on commit 5634b22

Please sign in to comment.