[PATCH v3] ld: Issue an error if group nested too deeply

H.J. Lu hjl.tools@gmail.com
Fri Aug 15 13:19:05 GMT 2025


On Fri, Aug 15, 2025 at 2:40 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 15.08.2025 06:07, H.J. Lu wrote:
> > @@ -3673,8 +3680,10 @@ open_input_bfds (lang_statement_union_type *s,
> >               plugin_insert_save = plugin_insert;
> >  #endif
> >               undefs = link_info.hash->undefs_tail;
> > +             (*nested_group_count_p)++;
>
> Personally I consider such (slightly) harder to read, compared to
>
>                 ++*nested_group_count_p;

Fixed in v4.

> >               open_input_bfds (s->group_statement.children.head, os,
> > -                              mode | OPEN_BFD_FORCE);
> > +                              mode | OPEN_BFD_FORCE,
> > +                              nested_group_count_p);
> >             }
> >           while (undefs != link_info.hash->undefs_tail
> >  #if BFD_SUPPORTS_PLUGINS
> > @@ -3684,6 +3693,7 @@ open_input_bfds (lang_statement_union_type *s,
> >                  || (plugin_insert != plugin_insert_save && plugin_undefs)
> >  #endif
> >                  );
> > +         *nested_group_count_p = 0;
>
> Didn't you mean this to be a decrement now? Otherwise I don't see how this
> addresses my earlier concern.
>

Fixed in v4.

Thanks.

-- 
H.J.


More information about the Binutils mailing list