Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a.out replaced by ELF file format?

I have a few questions:

  • Why was a.out replaced by ELF?
  • What were the major flaws in the a.out format that led to the raise of ELF file format?
  • Earlier core dumps were based on a.out, but now they are based on ELF. What are the various advantages provided by ELF?
like image 343
Karthik Balaguru Avatar asked Feb 28 '10 19:02

Karthik Balaguru


1 Answers

The a.out format forced shared libraries to occupy a fixed place in memory. If you wanted to distribute an a.out shared library, you had to register its address space. This was good for performance but it didn't scale at all. See for yourself how tricky it was (linuxjournal).

By contrast, in ELF, shared libraries can be loaded anywhere in memory, and can even appear to be at different addresses to different applications running on the same computer (with the code still effectively loaded in only one place in physical memory)! In order to achieve this, in the IA-32 architecture, a register (%ebx) has to be sacrificed. A more comprehensive reference showing that shared libraries got more complicated in ELF, but that was compiler-side complexity, as opposed to programmer-side.

like image 128
Pascal Cuoq Avatar answered Sep 20 '22 18:09

Pascal Cuoq