OSX GNU assembler issue with foo @plt call

In an attempt to build 64-bit PicoLisp on Mac OS X (10.6.7), it seems like I ran into a problem with OSX Dev. Tools GNU assembler ('as'), which is version 1.38. My Xcode is version 3.2.4. The lines in my (generated) x86-64.darwin.base.s that cause the problems usually look like this:

call foo@plt

... and they give me error messages like:

x86-64.darwin.base.s:41694:junk `@plt' after expression

The 64-bit version of PicoLisp works seamlessly on Linux and SunOS. On these platforms, there are probably more powerful (newer) versions of GNU builders. I don’t know if new GNU developers are available for OSX / Darwin ... or can there be other solutions?

If you want to try this yourself on OSX / Darwin, I can provide you with some files that you need.

+3
source share
1 answer

Unfortunately, I think there are at least two significant issues here:

  • "PLT" is an ELF concept, but OS X uses a completely different file / executable format - Mach-O.
  • Apple asseems to be pulling out of the fork of a much earlier version of the GNU assembler, and in some places the syntax (and command line options) are very different from recent versions (even if these concepts are the same).

It seems like some work on i386 and x86-64 Mach-O support has recently been in binutils ; it might be worth exploring the latest version (2.21). But if the generated assembler code is trying to do smart things specific to ELF, you are likely to have some serious problems ...

+4

All Articles