Skip to content

javaaiorg/patchelf-recurse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

patchelf-recurse

This project depends on NixOS's patchelf >>>

Combining linux executable programs and dependent dynamic link libraries.

After using this program, you can port CentOS 8 programs to CentOS 7 for execution. In theory, you can even port them to Ubuntu and other systems.

  1. Recursive analyze
  2. Support folder analyze
  3. Solve the problem of ld-linux-x86-64.so.2 dependency

More information>>>

Usage example

First, put your application to a directory, like /root/x64:



Then, download and uncompress patchelf-recurse.tar.gz to /root directory:

wget https://www.javaai.org/uploads/file/20240607/1717772613420044993.gz -O patchelf-recurse.tar.gz
tar -zxvf patchelf-recurse.tar.gz



Use patchelf-recurse.sh to combine executable application and dynamic libs:

./patchelf-recurse/patchelf-recurse.sh x64

After this, you can see all dynamic lib references become reletive path(looks like absolute path, but actually is reletive path, ldd command will parse reletive path to absolute path for display):

ldd x64/searchd



Copy your application to target machine, and then use the following commands to repaire intepreter:

./patchelf-recurse/patchelf-repaire-ld-linux.sh x64

You muse execute this command on target machine, because interpreter always be absolute path, after you done, you will see the elf file's interpreter becomes absolute path:

Every time you change the application's directory, you must execute patchelf-repaire-ld-linux.sh again, because elf file's interpreter path always be absolute.

Enjoy your repaired standalone application:



About

recurse patchelf,make linux application independent, portable. https://www.javaai.org/a/c892d1e98fd94a64018ff34a0b8b0007

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages