[Toybox] Still poking at shell corner cases...

Rob Landley rob at landley.net
Tue Jul 2 00:36:56 PDT 2019


On 7/1/19 4:06 PM, enh wrote:
>> Not _all_ the hard parts, but some of them. (And I still want to support 32 bit,
>> embedded systems still use it...)
> 
> supporting 32-bit from a 32-bit binary is fine, and supporting 64-bit
> from a 64-bit binary is fine, but supporting the other bitness than
> your strace binary is a nightmare if you actually want to decode
> anything (and if you don't, you're basically useless anyway). most of
> the bulk of the existing strace goes into dealing with this.

strace64 can exec strace32 if /proc/$PID/exe has a 32 bit ELF signature.

If you "ln -s /path/to/32bit/toybox /blah/strace" and then "ln -s /blah/strace
/bin/strace32" toybox knows how to do one level of readlink() to see if the name
turns into something it recognizes. :)

Putting a usable strac32 in the $PATH is of course left as an exercise for the
reader. But if the system can run 32 bit binaries, it can run a 32 bit strace
binary, and the 64 bit strace binary can hand off.

Rob



More information about the Toybox mailing list