0

I figure this question comes up often, but here goes: I have a testMyFoo binary that

  1. Is installed on the phone's /data/local/tmp/ path
  2. has appropriate execute permissions
  3. requires a series of shared-object libraries (one of them being libc++_shared.so)
  4. set the LD_LIBRARY_PATH variable with the required search paths
  5. is built with the correct toolchain+sysroot for the phone (arm64-v8a/android33)

So when I try to execute ./testMyFoo:

  1. It seems to execute
  2. It finds my dependent shared-object libs
  3. It fails to load libc++_shared.so

I get this error:

CANNOT LINK EXECUTABLE "./testMyFoo": couldn't map "/storage/emulated/0/MLZ/mlz-libs/libc/libc++_shared.so" segment 1: Permission denied

From what I've read online, it seems I have to run this through an Android studio project. I would like to avoid that (for now), and just run my program directly. Any suggestions?

Thanks, Charles.

0

1 Answer 1

0

Usually the shared internal storage /storage/emulated/0 is mounted with no execute restriction.

It seems this does not only affect executables but also libraries loaded by executables and thus you get an Permission denied.

You should better copy the libraries so that they are located in the same directory as your binary. libraries not together with the binary in /data/local/tmp. Then loading the libraries should work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .