Computer Science Canada Linking C & ASM (Mac OS 10.6) |
Author: | DtY [ Wed Feb 17, 2010 8:44 pm ] | ||||||||
Post subject: | Linking C & ASM (Mac OS 10.6) | ||||||||
I'm having trouble linking C and Assembly, I seem to be getting different target processors on both. The files I'm using: driver.c
first.asm
asm_io.inc This is from the book I'm using: http://www.drpaulcarter.com/pcasm/ To compile:
Gives me:
I'm pretty sure the problem is with the -arch flag, but I tried i386, i486 and i686, but none worked. [edit] Whoops, have to assemble asm_io.inc Problem persists though |
Author: | DtY [ Thu Feb 18, 2010 4:22 pm ] | ||
Post subject: | RE:Linking C & ASM (Mac OS 10.6) | ||
So apparently, there were two errors in here that I worked out today (1) Mac OS X doesn't use ELFs, it uses macho (2) asm_io.inc is not the actual library, it's just a header. So now, it links fine, but I get a seg fault when I run it. Here's the complete first.asm
|