Being nerd sniped into thinking I could learn how to do the same thing for X64.
Backing away from the assembler.
Backing away from the assembler.
It's not so easy to find it by naively testing for ignored header fields, since it depends on the precise details of which sizes and addresses must have the same alignment within a page. I instead proceeded from first principles, by studying the ELF loader and determining which programs are definitely ruled out.