This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why GNU ARM Toolchain objcopy didn't redefine and strip symbols, what a possible workaround?

I have Android shared library with armeabi-v7 architecture, and I need to rename some functions inside this.

Firstly, I tried ARM toolchain v4.9 of Android NDK.

I tried:

objcopy --redefine-sym _Z3foo1v=_Z3foo2v libTest.so libTestResult.so

It throws no errors, but it keeps new library identically to old, even CRC hashes are equals.

Next, I also tried all another ARM toolchains of Android NDK: ARM v4.8 toolchain, x86 toolchain, and same problem.

Finally, I downloaded official GNU ARM Embedded Toolchain - https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads - and still have same problem: now CRC is changing, but symbol still have old name.

Why this feature works with "essential" GNU toolchain for Linux, but didn't implemented in ARM toolchain?

How to work-around this?

Parents
  • I've not tried this before, but experimenting a little... try passing one library at once.

    In my very quick test, it performed the substitution only on the last file in the file list I passed it. Not sure if this is how it's intended to work.
Reply
  • I've not tried this before, but experimenting a little... try passing one library at once.

    In my very quick test, it performed the substitution only on the last file in the file list I passed it. Not sure if this is how it's intended to work.
Children