strip producing invalid executable

H.J. Lu hjl.tools@gmail.com
Mon Sep 15 18:22:02 GMT 2025


On Mon, Sep 15, 2025 at 10:54 AM Paul Edwards <mutazilah@gmail.com> wrote:
>
> On Mon, Sep 15, 2025 at 6:33 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> > The section header is wrong:
> >
> > The SHF_ALLOC bit is unset on  .text  and .data sections.
>
> Thanks a lot for that diagnosis. The pdld author has fixed
> that issue plus another anomaly, and now strip is handling
> the executable.
>
> I don't have any comment about whether strip should be
> able to detect a defective but working executable as I
> provided. I'm focused on fixing definite bugs.
>
> Note that strip is actually producing a larger executable now:
>
> 2025-09-16  01:16 AM            39,436 pdptest.orig4
> 2025-09-16  01:16 AM            39,476 pdptest.strip4

GNU strip rarely keeps the same size.  40 byte difference
is normal.

>
> Available in this NEW file:
>
> https://pdos.org/stripbug2.zip
>
> Apparently due to harmless rearranging done by strip.
>
> The pdld author says both are valid, but thought you might
> be interested in rearranging sections to conserve space.
>
> So just letting you know in case you are.
>
> Or if you believe he is using non-standard ordering, please
> let me know.
>
> Thanks. Paul.



-- 
H.J.


More information about the Binutils mailing list