Hi Mark,

On Wed, Nov 6, 2024 at 2:35 PM Mark Wielaard <m...@klomp.org> wrote:
> >    if (reloc_debug_only)
> >      {
> > +      if (ehdr->e_type != ET_REL)
> > +     {
> > +       /* Only ET_REL files should have debug relocations to remove.  */
> > +       error (0, 0, _("Ignoring --reloc-debug-sections-only for " \
> > +                      "non-ET_REL file '%s'"), fname);
> > +       goto fail_close;
> > +     }
>
> Do we have to fail here?  I think it is nicer for the user to just
> turn this into an warning with
>
> if (ehdr->e_type != ET_REL) else if (handle_debug_relocs (...))

If we don't fail then strip will need to do more work copying sections
over to the 'newelf' handle in order to properly overwrite the input file
with newelf.

Since --reloc-debug-sections-only should be a no-op for non-ET_REL files
it makes sense to skip that extra work and avoid overwriting the input file.

Aaron

Reply via email to