Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22569

./a.out: Permission denied

$
0
0

I've written a simple hello-world program in C:

#include <stdio.h>

int main() {
   /* my first program in C */
   printf("Hello, World! \n");

   return 0;
}

I run gcc main.c, and this finishes with no errors or warnings. I've tried chmod a+x a.out and chmod 755 a.out. This is on my hard drive, which means it's not a noexec file system.
ls -l a.out gives me this:
-rwxr-xr-x 1 keith keith 13932 Feb 15 13:20 a.out
And yet, ./a.out gives me: bash: ./a.out: Permission denied
I've tried with and without sudo, and neither one works. Any help is appreciated. EDIT:

file ./a.out gives: ./a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped
ldd ./a.out gives: ldd: warning: you do not have execution permission for `./a.out'
        not a dynamic executable // 
LD_DEBUG=all ./a.out gives: bash: ./a.out: Permission denied
uname -a gives: Linux localhost 3.8.11 #1 SMP Sun Jul 14 00:09:57 PDT 2019 armv7l ARMv7 Processor rev 4 (v7l) SAMSUNG EXYNOS5 (Flattened Device Tree) GNU/Linux
gcc -v gives: Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/armv7l-cros-linux-gnueabihf/8.3.0/lto-wrapper
Target: armv7l-cros-linux-gnueabihf
Configured with: ../configure --prefix=/usr/local --libdir=/usr/local/lib --build=armv7l-cros-linux-gnueabihf --host=armv7l-cros-linux-gnueabihf --target=armv7l-cros-linux-gnueabihf --enable-checking=release --disable-multilib --enable-threads=posix --disable-bootstrap --disable-werror --disable-libmpx --enable-static --enable-shared --program-suffix=-8.3.0 --with-arch=armv7-a --with-tune=cortex-a15 --with-fpu=neon --with-float=hard
Thread model: posix
gcc version 8.3.0 (GCC) 

Viewing all articles
Browse latest Browse all 22569

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>