Re: OS X: Leading underscores and symbol name redirection

  • From: Mike Pall <mike-1208@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 25 Aug 2012 13:07:12 +0200

Miles wrote:
> Sure, but I wasn't sure if LuaJIT's difference here from how compilers
> behave on OS X was known or considered acceptable, as I couldn't find
> it referenced anywhere.

Well, __asm__("...") is defined to hold the raw symbol name, so
that's what LuaJIT is doing. The real problem is that dlsym() on
OSX prepends an underscore, which is Apple's workaround for their
unsound design decisions wrt. the executable format. Sadly, the
damage cannot be undone and IMHO adding yet another workaround on
top of it isn't going to improve matters.

--Mike

Other related posts: