NixOS / patchelf

A small utility to modify the dynamic linker and RPATH of ELF executables
GNU General Public License v3.0
3.57k stars 486 forks source link

rename-dynamic-symbols produces unusable binary #540

Open J-cztery opened 10 months ago

J-cztery commented 10 months ago

Describe the bug

Library produced by renaming dynamic symbol is unusable and cannot be recognized by ldd. nm -a -D shows correct symbols in it.

Steps To Reproduce libcoi_host.so.0.gz gzip -d libcoi_host.so.0.gz echo "COIEventRegisterCallback COIEventRegisterCallback_Disabled" > symbol_map patchelf --output libcoi_host_patched.so --rename-dynamic-symbols symbol_map libcoi_host.so.0 ldd libcoi_host_patched.so not a dynamic executable Expected behavior

I would expect a shared library without COIEventRegisterCallback symbol, with COIEventRegisterCallback_Disabled present (this works) with a library that is recognized by ldd. The input library is recognized by ldd.

patchelf --version output

patchelf 0.18.0

Additional context

Tested on Rocky 8 and Centos 7