'Redefining symbols from shared library
I have a requirement on changing certain symbols from shared library (.so) files like below example:
i need to rename symbol abc in .so file to symbol xyz. I have a tool to replace it in header files, only challenge i am facing for changing in my .so shared libraries.
For shared libraries, are there any tools or commands which can help me to disassemble .so files, update the symbols and reassemble again to .so files?
For shared libraries, we need a mechanism to reconstruct symbol tables. Need help if any tools exists to do my task?
FYI: changing source is the best approach, but for short-term looking at solution which can help to replace code words at symbols level.
Solution 1:[1]
You can use objcopy from GNU binutils to do this.
objcopy --redefine-sym abc=xyz <input_so_file> [output_so]
objcopy --redefine-syms <Filename> [output_so]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
