Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ancient history question: What was the main problem the creators of the ELF were trying to address at the time the ELF was adopted?


There's a brief explanation here:

http://en.wikipedia.org/wiki/COFF#History

(ELF replaced COFF)


Shared libraries?

Forwarding to the present day, with ample inexpensive memory and secondary storage space available, what if for some strange reason I do not use shared libraries in my project? Is there still a need for ELF? Why or why not?


I'm not following your intent. ELF is the current modern standard file format for specifying executables. It's just how you store executable machine code in a way that Linux/Unix systems know how to load the program into RAM and begining execution.

As such, generally speaking, yes, ELF is needed for all machine code executables regardless of minor details like shared libraries.

Before ELF, COFF was used. Before COFF, Unix used multiple generations of so-called "a.out" format.

Except as an exercise in retro-computing, one can no longer use those older file formats because modern tools no longer support them.

If you are unhappy with the complexity of generating ELF, you might look into whatever Fabrice Bellard did with his remarkably tiny "tcc" C compiler.

Incidentally, in recent years more and more people are starting to ask "do we really need shared libraries in today's era of huge amounts of RAM?" -- whatever the answer, it's a reasonable question.


Your last line more or less captures my "intent".

The idea is that if someone can reconsider the need for shared libraries, then could she also reconsider the need for ELF?

But maybe there are other pertinent reasons that ELF exists, besides shared libraries?


I already answered that very directly:

> ELF is the current modern standard file format for specifying executables. It's just how you store executable machine code in a way that Linux/Unix systems know how to load the program into RAM and begining execution.

There is no other way to implement executables. And if there were, it would look just like ELF, from twenty thousand feet.

ELF has nothing in particular to do with shared libraries, and shared libraries still exist if ELF does not, they just have some implementation difficulties in some cases.

It's like saying, what if you didn't need any networking code, would you still need ELF? Yes you would. What if you didn't need GUI code? Yes, you still need executables.

You seem to have gotten a misconception about ELF really fixed in your mind. It is the one and only way to store executables. Without it, you have no tools, no commands, no apps, no way to run any software, no nothing.

Shared libraries are a small side feature and don't have very much to do with ELF, despite the fact that ELF made it easier to implement them.

Also, I mentioned that people have questioned the need for shared libraries, but I fail to see any motivation whatsoever for why anyone might want to get rid of ELF.


    What is ELF? (top)

   ELF is a binary format designed to support dynamic objects
 and shared libraries. On older COFF and ECOFF systems,
 dynamic support and shared libraries were not naturally
 supported by the underlying format, leading to dynamic
 implementations that were at times complex, quirky, and
 slow.
source: netbsd.org

However you said "ELF has nothing in particular to do with shared libraries..."

Perhaps the concept of a binary format has nothing in particular to do with support for shared libaries. Perhaps that is a design choice. And perhaps ELF is merely one approach to the design of a binary format.

If true, then this choice makes a lot of sense in a world where there is a compelling need to use shared libraries, such as the computing world 20 years ago. But I am not so sure the same holds true in a world where the need for shared libraries is "questionable".

You said "Shared libraries are a small side feature..."

If that is true (cites to articles appreciated), then I would be curious what are ELF's "main" features, and how these differ from the formats that preceded ELF (e.g., a.out). Also I would be curious how frequently ELF's "minor" features have historically been used in practice, as opposed to just adding complexity and taking up space.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: