Hacker News new | past | comments | ask | show | jobs | submit login

For anyone missing COM files, it's not very difficult to slap a (nearly) constant ELF header on what is basically a glorified COM file to generate a valid executable.

(hmm... I haven't done this since widespread W^X; it might be a little more difficult these days but if so anyone who's had to write ROMable code will know the usual workarounds)




You can explicitly mark a memory area as write and execute in the elf header. Totally unsafe, but saves important bytes


That's what I had been doing, but I had been guessing that "mandatory W^X" meant a loader should ignore it even if requested?

(for the historians, we're basically discussing the difference between OMAGIC [0407] and NMAGIC [0410] a.out formats, both of which are much simpler than ELF)

PS. salut, balou !




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: