I am using Kali linux 64 bit and I am trying to execute the following programs from Dr. Paul carter's website. The gcc command is giving errors. What should I use in the gcc command?
nasm -f elf32 array1.asm
root@kali:assembly# gcc -o array1 array1.o array1c.c
array1c.c:9:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
array1c.c:10:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
/usr/bin/ld: i386 architecture of input file `array1.o' is incompatible with i386:x86-64 output
collect2: error: ld returned 1 exit status
You are attempting to link a 32 bit object file i386
to a 64 bit executable (i386:x86-64
). Add -m32
to the gcc
compilation line to create a 32 bit executable.
nasm -f elf64 array1.asm
then
ld -s -o array1 array1.o
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With