3 ms·
On Linux. Did FreeBSD switch?
by flatiron 5y ago
On Linux. Did FreeBSD switch?
- toast0 5y agoYeah; looks like in the FreeBSD 3.0 release (October 1998), mentioned in old versions of the FreeBSD handbook[1]: > FreeBSD comes from the ``classic'' camp and used the a.out(5) format, a technology tried and proven through many generations of BSD releases, until the beginning of the 3.X branch. Though it was possible to build and run native ELF binaries (and kernels) on a FreeBSD system for some time before that, FreeBSD initially resisted the ``push'' to switch to ELF as the default format. [...] > So ELF had to wait until it was more painful to remain with a.out than it was to migrate to ELF. > However, as time passed, the build tools that FreeBSD derived their build tools from (the assembler and loader especially) evolved in two parallel trees. The FreeBSD tree added shared libraries and fixed some bugs. The GNU folks that originally write these programs rewrote them and added simpler support for building cross compilers, plugging in different formats at will, and so on. Since many people wanted to build cross compilers targeting FreeBSD, they were out of luck since the older sources that FreeBSD had for as and ld were not up to the task. The new GNU tools chain (binutils) does support cross compiling, ELF, shared libraries, C++ extensions, etc. In addition, many vendors are releasing ELF binaries, and it is a good thing for FreeBSD to run them. > ELF is more expressive than a.out and allows more extensibility in the base system. The ELF tools are better maintained, and offer cross compilation support, which is important to many people. ELF may be a little slower than a.out, but trying to measure it can be difficult. There are also numerous details that are different between the two in how they map pages, handle init code, etc. None of these are very important, but they are differences. In time support for a.out will be moved out of the GENERIC kernel, and eventually removed from the kernel once the need to run legacy a.out programs is past. It looks like default support of a.out was removed in 5.0 (January 2003), but you can still load a kernel module (shipped with the generic kernel) or compile a custom kernel with support built in. At least on i386/amd64. [1] https://docs.freebsd.org/doc/4.9-RELEASE/usr/share/doc/handbook/binary-formats.html https://docs.freebsd.org/doc/4.9-RELEASE/usr/share/doc/handb...
- bell-cot 5y agoFrom a quick look at the FreeBSD 13.0-RELEASE Release Notes ( https://www.freebsd.org/releases/13.0R/relnotes/ https://www.freebsd.org/releases/13.0R/relnotes/ ) and the a.out-related commits that it links to, I'd say that FreeBSD is close to having a.out fully walked to the door. (They suggest installing a ~2-decade-old version of FreeBSD if you still need to work with a.out...)
- toast0 5y agoI see that in the release notes, but they still have the kernel module available in GENERIC, and the config available. Maybe they don't do anything though :)