Hello all,
I'm trying to move some of my code over from nasm in Linux to MacOS X. I have a simple mixed C/assembly program. The problem is that the C version is prepending _ to the symbols, so the link fails. I can manually fix this by renaming my assembly routines, but this is not ideal. Here's a simplified testcase which works fine under Linux. Thanks for any suggestions,
# nasm -f macho test1.asm
# gcc -m32 -c test.c
# gcc -m32 test.o test1.o
Undefined symbols:
"_asmFunc", referenced from:
_main in test.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
test.c:
extern int asmFunc(int);
int main(int argc, char *argv[])
{ return asmFunc(1); }
test1.asm:
SECTION .text
global asmFunc
asmFunc:
mov eax, [ebp + 4]
ret