There is a dynamic library elf/so in which I rewrote several functions to the ones I needed (using the id pro, I wrote my functions in place of the original ones - which are not needed). Now I need to add a few more functions, but there is no free space left, how can I add a new section of code or increase the existing one?

Objcopy (--add-section) Doesn't fit, as it's a ready-made library with symbols, Maybe it's possible to parse the library into an Object file and symbols, then add a new section of code and then reconnect Symbols and code?

Or I will have to write a new library with my own code, but I don’t know how to further load it into memory and call the necessary functions from it.

  • You can write a library with just the functions you want to export and load it via LD_PRELOAD You don't need to change existing library implementation.
    – sudhackar
    Mar 4 at 8:19


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.