4 ms·
Writing Assembly on OpenBSD (x86) (2012)
- echochar 11y agoWhat 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.
- bootload 11y agoFrom 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"
- ori_b 11y agoWhat 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.
- i4k 11y agoNot related to your comment, but... 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!
- freebasedgirl 11y agoOpenBSD 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 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.