Can't run my own programs ?!

I've got a basic system running using Busybox and Tinylogin, but I can't seem to run my own programs.

In the example below my program is called 'hesc', but as you can see, the system says the file doesn't exist. What is going on ?

# pwd /tmp # ls -l

-rwxrwxrwx 1 0 0 25 May 9 10:14 a

-rwxr-xr-x 1 0 0 14883 May 9 10:16 hesc # ./hesc ./hesc: No such file or directory # ls -l ./hesc

-rwxr-xr-x 1 0 0 14883 May 9 10:16 ./hesc #

Reply to
noreply
Loading thread data ...

This is usually an indication that the dynamic loader which is supposed to load your program doesn't exist. E.g.

$ echo 'int main() { printf("Hello\n"); return 0; }' > junk.c && gcc -g junk.c && ./a.out Hello

$ gcc -g -Wl,-dynamic-linker=/no/such/file junk.c && ./a.out bash: ./a.out: No such file or directory

$ ls -l a.out

-rwxrwxr-x 1 paul users 13836 May 9 08:14 a.out

You can find out which dynamic linker your program was compiled to use with:

$ objdump -sj.interp ./a.out ... Contents of section .interp: 80480f4 2f6e6f2f 73756368 2f66696c 6500 /no/such/file.

Another possibility (not very likely) is that /tmp is mounted with noexec option.

Cheers,

--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Reply to
Paul Pluzhnikov

You are right..It's now working, but the image is HUGE. I think it's about time I started using shared libraries instead of building things -static.

Thanks again.

Paul Pluzhnikov wrote:

Reply to
noreply

Are you sure you are root when you are trying this? The hesc and a files are both root:root (the two 0's indicate that).

Good luck, Freddy

Reply to
Freddy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.