diff --git a/macho/main.cc b/macho/main.cc index 447d0717..c5a485cd 100644 --- a/macho/main.cc +++ b/macho/main.cc @@ -17,11 +17,10 @@ static void add_section(Context &ctx, OutputSection &osec, std::string_view segname, std::string_view sectname) { for (ObjectFile *obj : ctx.objs) { for (std::unique_ptr &sec : obj->sections) { - if (sec->hdr.segname == segname) { - if (sec->hdr.sectname == sectname) - for (Subsection &subsec : sec->subsections) - osec.members.push_back(&subsec); - sec->osec = &osec; + if (sec->hdr.segname == segname && sec->hdr.sectname == sectname) { + for (Subsection &subsec : sec->subsections) + osec.members.push_back(&subsec); + sec->osec = &osec; } } }