Question 1: That no suitable image was found
[Answer] You tried to install the LD_LIBRARY_PATH export, or instead set -rpath
Question 2: What does the error message "mmap () error 1" mean.
[Answer]
One possibility: In principle, the key point of dlopen is to establish a memory mapping between your library in the disk file in system RAM.
"mmap () error 1 at address = 0x101CE4000, size = 0x00004000"
means that the OS will map the file to the virtual memory address 0x101CE4000 (which is page aligned), and the size is 4 pages (16384 bytes).
since such an attempt failed, I suspect that there is enough free memory in your system bass to carry the display.
Another possibility:
mmap used in dlopen can use the MAP_FIXED flag to perform the mapping, so it is possible that it will complete the condition that the kernel selects a virtual address, which should be mmaped, but its property is not executable.
On the man page in mmap:
"The prot argument asks for PROT_EXEC, but the displayed area belongs to the file system file that no-exec was installed."
If you can modify the dlopen () file, simply remove the MAP_FIXED flag, if any.
In general, it is interesting to understand what an error value (non-return value) is set via mmap (). You can do this using strace, which shows why the system call is not working.
source share