I'm currently working on an implementation of MD5 just because I'm curious and want to get a better understanding of how hashing works. I have 1 file with all the code in it, called easy_md5.c and I'm compiling it with the following Makefile:
easy_md5: easy_md5.c
gcc -c easy_md5.c -o easy_md5
clean:
-rm -f easy_md5.o
-rm -f easy_md5
I ran chmod +x easy_md5 on the executable to give it permission, and yet I'm getting the following error when I try to run it:
[gabe@void easy_md5]$ ./easy_md5 hello
bash: ./easy_md5: cannot execute binary file: Exec format error
Running file easy_md5 shows the following:
easy_md5: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
and running arch confirms my machine has x86-64 architecture. Since its a 64-bit executable, there's no reason it should throw a format error when I try to run it on my 64-bit machine. What is going wrong?