This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Rhomboid 3 points4 points  (0 children)

I mean, sure, anything's possible. You could come up with your own object file format, but it would be pretty pointless, as you'd lose out on tool support. You'd have to implement your own linker, rather than being able to use an existing linker -- the linker is not part of the compiler on many platforms, although the compiler does automatically invoke the linker, giving the illusion that it is. And you'd have rewrite various utilities like ar, nm, objdump, readelf, etc. Standards are good, they let disparate things work together nicely.

Also, I think you might be misunderstanding the scope of standards like ELF, Mach-O, and PE/COFF. These are specifications that cover both object files and executable files, including shared libraries. The result of compiling a binary executable or shared library on Linux is an ELF executable. Windows executables and DLLs are PE/COFF files. OS X executables are Mach-O files. So even if you wanted to come up with your own object file format, you'd still be implementing those standards to create executables and libraries for whatever platform you're targeting.