What is the purpose of the .note section? If it is left out, it appears from ktrace that the kernel assumes the binary uses some other ABI, e.g., Linux, etc. (compat_linux, etc.) and the /emul shadow directory gets searched.
From the document: "OpenBSD native executables usually contain a .note.openbsd.ident section to identify themselves, for the kernel to bypass any compatibility ELF binary emulation tests when loading the file"
What I'm curious about is whether there's a good writeup of what you need to do to handle the (presumably) ASLR that OpenBSD has.
I've been having a hell of a time figuring out what's going on when I try to port Myrddin -- the code I generate will often segfault, on a string that GDB seems to think is perfectly valid, and happily prints. Some of the strings have clearly wonky addresses, (eg, within the zero page), others don't look insane.
OpenBSD is a great platform to find those bugs in your asm/c. Segfaults that would not happen on Linux. (e.g. closing a file before exit that you never opened).
http://nixdoc.net/man-pages/OpenBSD/malloc.conf.5.html is also another great place to tweak memory allocation behaviors to find those application corner cases that break.
5 comments
[ 2.4 ms ] story [ 24.6 ms ] threadI've been having a hell of a time figuring out what's going on when I try to port Myrddin -- the code I generate will often segfault, on a string that GDB seems to think is perfectly valid, and happily prints. Some of the strings have clearly wonky addresses, (eg, within the zero page), others don't look insane.
Thanks for Myrddin! It's a very promising language! Well designed and using the right tools.
People of #cat-v showed it to me and since then I look forward to play with it!