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

I think what the author likes is the fact that the first 4 bytes are defined as 0x7F followed by the file extension "ELF" in ASCII, which makes it a quite robust identifier.

And to be fair, including the 4 byte following the magic number make the ELF-format qualify at least 3 out of the 4 'MUST' requirements:

_ 7F 45 4C 46

- 0x04: Either 01 or 02 (defines 32bit or 64bit)

- 0x05: Either 01 or 02 (defines Little Endian or Big Endian)

- 0x06: Set to 01 (ELF-version)

- 0x07: 00~12 (Target OS ABI)

Still not a shiny example though...



Maybe, yes. There are certainly worse offenders than ELF, but I still don't see how it satisfies 3 out of the 4 MUSTs. There is no byte with the high bit set and it is a valid ASCII sequence and therefore also valid UTF-8.

When it comes to the "eight is better" requirement, at least Linux does not care what comes after the fourth byte for identification purposes, so I think that does not count either.




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

Search: