On Fri, 2004-05-14 at 21:53 +0900, Dmitry Timoshkov wrote:
Can you list at least some things you think are bad in PE in comparison with ELF?
Sure - ELF has decent versioning, which PE lacks and has caused massive pain due to conflicts etc. While you can rename DLLs on Windows it's not a part of the system so not many people do, and when they do there's no pattern to it.
The ELF file format is fairly simple compared to PE where you have layers of wrappers and cruft due to its long history.
ELF is well specified for multiple CPU architectures and standard between several different operating systems. I can get the spec in many formats. The PE spec in contrast comes in the form of a Word document, and I have to agree to a bigass EULA to read it:
http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
ELF is pretty easy to extend with new sections and flags.
Another downside in ELF in addition to mentioned already is missing a resource section, which makes our life implementing Wine much harder and forces all application developers invent their own formats to store icon/bitmap/dialog info/strings/etc. information.
Actually I see that as a benefit: PE resource files are IMHO a rather dubious feature. Yes it makes implementing Wine harder, but any time I see a filing-system-in-a-file I get suspicious. Sticking files inside the EXE or DLL just makes them harder to get at, harder to replace or edit: we already have a working filing system so reinventing that in a limited fashion seems silly. I think keeping code and data physically separate is a much better plan.
In the rare case that you need to store binaries inside ELF it's still possible: see GTK+ which does this for its stock artwork.
Finally, the linking semantics of ELF are as much a blessing as a curse. While it can cause chaos sometimes, it also lets us do things like the pthread override trick. Any LD_PRELOAD hack also uses this "feature", though it could be done more cleanly with an extension.
Modern (ie GNU) ELF also has various interesting features like symbol versioning, prelinking etc ...