
Writing Assembly on OpenBSD (x86) (2012) - mulander
https://web.archive.org/web/20120509101207/http://lucifer.phiral.net/openbsdasm.htm
======
ori_b
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.

~~~
i4k
Not 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!

------
echochar
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.

~~~
bootload
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"_

------
freebasedgirl
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](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.

