View Single Post
Majost
monkey with a tiny cymbal
 
Join Date: Nov 2004
Location: Lost
 
2010-04-12, 23:54

That ld warning is the key. I don't know how much you've covered in your class about the stages of compilation, but the linker (ld) goes through the generated object files, figures out where the symbols are, and then properly connects everything into one executable file. It's saying that it can't read your vecsum.o file (not entirely true... but...), and thus it cannot resolve the symbol that's defined inside it.

I Googled asm ld: warning: file is not of required architecture and my top link (which may be biased based on my search history) was this stack overflow question and answer.

Three things here: Warnings are very important. Google is awesome. Stack Overflow is awesome. Learn to use and love them both.

Edit: since I feel guilty about the fib about ld reading vecsum.o.

Compare the difference between the output of file vecsum.o and file main.o. You'll see that they are "formatted" for different architectures. ld needs these files to be of the same architecture to link them together.

Last edited by Majost : 2010-04-13 at 00:08.
  quote