elf: working freebsd implementation