c – Error loading shared library libgcc_s.so.1: Not a directory (needed by ./bin/busybox

I want to run a busybox with qemu-arm-static
file busybox is output:

bin/busybox: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-arm.so.1, corrupted section header size

And when I use qemu-arm-static to run it ,I get output:

sudo chroot ./ ./qemu-arm-static --strace -E LD_PRELOAD="./lib/libgcc_s.so.1 ./lib/libc.so" ./bin/busybox

8703 set_tid_address(-159394608,-150997504,1,-159391584,-159394636,-159391584) = 8703
8703 open("./lib/libgcc_s.so.1",O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
8703 fcntl64(3,F_SETFD,1) = 0
8703 fstat64(3,0xf6fff298) = 0
8703 read(3,0xf6ffee98,936) = 936
8703 mmap2(NULL,110592,PROT_EXEC|PROT_READ,MAP_PRIVATE,3,0) = 0xf6763000
8703 mmap2(0xf677d000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED,3,0xa) = 0xf677d000
8703 close(3) = 0
8703 open("./lib/libc.so",O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
8703 fcntl64(3,F_SETFD,1) = 0
8703 fstat64(3,0xf6fff298) = 0
8703 read(3,0xf6ffee98,936) = 936
8703 mmap2(NULL,528384,PROT_EXEC|PROT_READ,MAP_PRIVATE,3,0) = 0xf66e2000
8703 mmap2(0xf675f000,16384,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED,3,0x6d) = 0xf675f000
8703 mmap2(0xf6761000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED,-1,0) = 0xf6761000
8703 close(3) = 0
8703 open("/etc/ld-musl-arm.path",O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
8703 fcntl64(3,F_SETFD,1) = 0
8703 fcntl64(3,F_SETFD,1) = 0
8703 readv(3,-150998608,2,1024,-159920112,1) = 22
8703 readv(3,-150998608,2,1024,-159920112,1) = 0
8703 close(3) = 0
8703 open("/lib/ld-musl-arm.so.1/libgcc_s.so.1",O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 errno=20 (Not a directory)
8703 writev(2,0xf6fff0a8,0x2)Error loading shared library libgcc_s.so.1: Not a directory (needed by ./bin/busybox = 84
8703 writev(2,0xf6fff3a0,0x2)) = 1
8703 writev(2,0xf6fff388,0x2)
 = 1
8703 mprotect(0xf675f000,4096,PROT_READ) = 0
8703 mprotect(0xf67fb000,4096,PROT_READ) = 0
8703 exit_group(127)

There are some information I also get

command: readelf -d bin/busybox | grep NEEDED
output:  
 0x00000001 (NEEDED)                     shared library:[libgcc_s.so.1]
 0x00000001 (NEEDED)                     shared library:[libc.so]

command: file lib/ld-musl-arm.so.1
output: lib/ld-musl-arm.so.1: symbolic link to libc.so

so, I want to know what’s wrong with it,and how can I run the busybox successfully,thanks!

I want to know what’s wrong with it,and how can I run the busybox successfully,thanks!

Read more here: Source link