From: sjg Date: Tue, 12 Jun 2012 17:15:24 +0000 (-0700) Subject: removed X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/commitdiff_plain/74e788e413620d11351ddca173ac07faa151c125 removed --- diff --git a/docs/handbook/handbook-binary-formats.mdwn b/docs/handbook/handbook-binary-formats.mdwn deleted file mode 100644 index d0cbb4ca..00000000 --- a/docs/handbook/handbook-binary-formats.mdwn +++ /dev/null @@ -1,32 +0,0 @@ -## Binary Formats - - - -To understand why DragonFly uses the [elf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=elf&section=5) format, you must first know a little about the three currently ***dominant*** executable formats for UNIX®: - - - - -* [a.out(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=a.out&section=5) - - The oldest and ***classic*** UNIX object format. It uses a short and compact header with a magic number at the beginning that is often used to characterize the format (see [a.out(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=a.out&section=5) for more details). It contains three loaded segments: .text, .data, and .bss plus a symbol table and a string table. - - -* COFF - - The SVR3 object format. The header now comprises a section table, so you can have more than just .text, .data, and .bss sections. - - -* [elf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=elf&section=5) - - The successor to COFF, featuring multiple sections and 32-bit or 64-bit possible values. One major drawback: ELF was also designed with the assumption that there would be only one ABI per system architecture. That assumption is actually quite incorrect, and not even in the commercial SYSV world (which has at least three ABIs: SVR4, Solaris, SCO) does it hold true. DragonFly tries to work around this problem somewhat by providing a utility for ***branding*** a known ELF executable with information about the ABI it is compliant with. See the manual page for [brandelf(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=brandelf&section=1) for more information. DragonFly runs ELF. - - - -So, why are there so many different formats? Back in the dim, dark past, there was simple hardware. This simple hardware supported a simple, small system. `a.out` was completely adequate for the job of representing binaries on this simple system (a PDP-11). As people ported UNIX from this simple system, they retained the `a.out` format because it was sufficient for the early ports of UNIX to architectures like the Motorola 68k, VAXen, etc. - -Then some bright hardware engineer decided that if he could force software to do some sleazy tricks, then he would be able to shave a few gates off the design and allow his CPU core to run faster. While it was made to work with this new kind of hardware (known these days as RISC), `a.out` was ill-suited for this hardware, so many formats were developed to get to a better performance from this hardware than the limited, simple `a.out` format could offer. Things like COFF, ECOFF, and a few obscure others were invented and their limitations explored before things seemed to settle on ELF. - -In addition, program sizes were getting huge and disks (and physical memory) were still relatively small so the concept of a shared library was born. The VM system also became more sophisticated. While each one of these advancements was done using the `a.out` format, its usefulness was stretched more and more with each new feature. In addition, people wanted to dynamically load things at run time, or to junk parts of their program after the init code had run to save in core memory and swap space. Languages became more sophisticated and people wanted code called before main automatically. Lots of hacks were done to the `a.out` format to allow all of these things to happen, and they basically worked for a time. In time, `a.out` was not up to handling all these problems without an ever increasing overhead in code and complexity. While ELF solved many of these problems, it would be painful to switch from the system that basically worked. So ELF had to wait until it was more painful to remain with `a.out` than it was to migrate to ELF. - -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.