Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
276 views
in Technique[技术] by (71.8m points)

gcc - Can't execute a file even after giving full permissions (in linux)

I compiled my C code using gcc and it gave me a .out file. Now I am trying to execute the output file using terminal it keeps on showing me some error

fish: The file “./core.out” is not executable by this user.

I am using fish shell - But I am getting same error on bash shell as well. I can't understand what could be the reason for this.

Command I used for gcc

gcc core.c -o core.out

Output of file core.out is

core.out: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, > BuildID[sha1]=28e5ebcbdf1336774f74c7167a529a05af4e236b, for GNU/Linux 3.2.0, not stripped.

Error I am getting is:

enter image description here

question from:https://stackoverflow.com/questions/65874259/cant-execute-a-file-even-after-giving-full-permissions-in-linux

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It was the noexec option on the mounted partition. It's working fine and as expected after remounting. Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...