nasm - Error in compilation of program using gcc -
while compiling nasm programm, command nasm -felf prgname.asm
works fine when use gcc command gcc -o prgname prgname.o driver.c asm_io.o
gives me error
file format not recognized; treating linker script /usr/bin/ld:asm_io.o:1: syntax error collect2: ld returned 1 exit status
i not understand error. has system architecture?
based on error output, it's not prgname.o
file that's causing issue asm_io.o
one. per output:
file format not recognized; treating linker script /usr/bin/ld:asm_io.o:1: syntax error
you can see it's treating some file textual linker script , complaining syntax error in asm_io.o
.
since tend syntax errors textual source code rather binary object files, it's safe bet file being treated linker script asm_io.o
one.
so should concentrate efforts there. first thing check both files see type are:
file prgname.o asm_io.o
i'm including first not because think it's wrong because, if it's right, it'll give indication of second 1 should be.
you leave asm_io.o
out of compilation command altogether. you'll unresolved symbol
errors it'll @ least prove file causing problem.
once you've established problem is asm_io.o
, you'll need rebuild (assuming have source) correct options.
Comments
Post a Comment