Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux 'cannot execute binary file' on every executable I compile, chmod 777 doesn't help

I am running red had linux 7.3 (old, I know), and for the past few months I've been learning assembly programming, writing small programs and compiling with nasm. For months, things have been going fine, and now for some unknown reason, I cannot execute any programs that I compile.

nasm file.s //used to work just fine, then I'd execute ./file

now, when I run ./file, first I get "permission denied", which never used to happen before. then, once i chmod +777 file, I get "cannot execute binary file".

I have NO IDEA why this is happening, but it is extremely frustrating since NOTHING I compile will run anymore.

Logging in as root doesn't change anything. All suggestions are welcome, THANK YOU!!

like image 701
rab b Avatar asked Dec 01 '25 21:12

rab b


1 Answers

nasm does not produce an executable, but just an object file (like gcc -c would). You still need to run the linker on it.

N.B.: “0777 is almost always wrong.”

like image 83
user502515 Avatar answered Dec 04 '25 13:12

user502515



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!