I was told by Apple that you aren't supposed to make syscalls in OS X, so I tried to changed my code to call the C standard library but I can't figure out how to make the stub for the linker. The docs are all for GAS and they say to make the stub like this:
.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
_printf_stub:
.indirect_symbol _printf
hlt ; hlt ; hlt ; hlt ; hlt
And the dynamic linker will replace the hlts with a jump to the function the first time you call the stub. I can't find any documentation for the Apple version of NASM, and the docs for the regular version has all of two sentences about MachO. Is creating a stub for system functions currently possible or is it as yet unimplemented?