rtldi is a program interpreter for ELF which enables the management of multiple glibc 6 libraries.
Traditionally, glibc6 should be backwardly compatible, meaning that the binary executable is compatible with any subsequent version of glibc6. However, in reality, there have been numerous bugs and glitches that have necessitated workarounds.
By specifying /2.2.4-24/rtldi as the PT_INTERP for an executable, users can effectively run programs with a similar effect to invoking it via /2.2.4-24/ld-linux.so.2 --library-path /2.2.4-24:$LD_LIBRARY_PATH /path/of/execve/a.elf args..., which in turn uses /2.2.4-24/libc.so.6 for its glibc6.
One of the most notable features of rtldi is that it uses its path prefix as the prefix for ld-linux.so.2 in the PT_INTERP. It also features a colon-separated list argument that follows --library-path, which replaces LD_LIBRARY_PATH for a specific executable without modifying it for any children it might invoke. This feature of ld-linux.so.2 ensures that the process name will remain unchanged.
To add rtldi to new ELF executables, users should build with the option -Wl,--dynamic-linker=/path/to/rtldi. For old executables using /lib/ld-linux.so.2 as their PT_INTERP, a binary file editor can be used to modify the string found at the offset of the INTERP string, which can be located using readelf --program-headers a.elf. The replacement string must not exceed the original length and must be terminated by '.
Overall, rtldi is an excellent tool for individuals requiring the simultaneous interoperability of programs linked using different versions of glibc6. Its ease of use, and the ability to specify individual runtimes and libraries, make it a must-have for any developer working with ELF executables.
Version 0.94: N/A