2 ms·
Halfway through the article I was wondering if it wouldn't be possible to write an ELF wrapper for a.out binaries. I was pleasantly surprised to not be the fir
by jandrese 5y ago
Halfway through the article I was wondering if it wouldn't be possible to write an ELF wrapper for a.out binaries. I was pleasantly surprised to not be the first person to consider that, and that it turned out to be easy to do.
- flatiron 5y agoAre you referring to https://www.freebsd.org/cgi/man.cgi?query=brandelf&sektion=1 https://www.freebsd.org/cgi/man.cgi?query=brandelf&sektion=1 ?
- jandrese 5y agoNo, that only works on ELF and was intended to make it easier for the Linuxulator to distinguish between FreeBSD and Linux ELF binaries.
- pavon 5y agoI like the binfmt_misc suggestion in the LWN comments. The fact that I could just run a jar file like it was an executable made me unreasonably happy when I first learned about it. It was one of those things (like X11 being network transparent) that made Linux seem almost magical to me as a 90's teen. Anyway, this seems like a perfect use case for that functionality.
- duskwuff 5y agoEven crazier: you can use binfmt_misc with qemu-user to transparently run Linux executables compiled for other architectures. Debian (and Ubuntu) packages the required configuration as "qemu-user-binfmt".
- gnufx 5y agoFor what it's worth, qemu-user-static is more general, e.g. for a foreign container image that won't find the shared library. (Wheeled out when it was said people needed to build ppc64le images on x86 boxes and it was impossible, rather than trivial.)
- lloeki 5y agoThat's exactly what Docker does behind the scenes to run foreign arch images, see https://github.com/tonistiigi/binfmt https://github.com/tonistiigi/binfmt
- hyc_symas 5y agoYeah, and a.out format is trivial enough that it wouldn't be much code to load these things.