Sunday, June 28, 2015

eatsyscall.asm could not read symbols: File in wrong format

If you are reading Assembly Language Step-by-Step: Programming with Linux (3rd edition) by Jeff Dantemann and you came to the first program eatsyscall.asm you'll probably get this error when you link the file with the command:

ld -o eatsyscall eatsyscall.o

eatsyscall.o: could not read symbols: File in wrong format

the solution is to add another parameter to the ld command:

ld -o eatsysdemo eatsyscall.o -m elf_i386


The problem is that you are running a Linux system where both 32bit and 64bit libraries are present and ld will complain if you link libraries of different types.
Enjoy the reading.

No comments:

Post a Comment

Your comment will be visible after approval.