Hi,
I'm using armclang compiler Product: Professional Component: ARM Compiler 6.16
There are unused functions which are linked in the final application. There functions are coming from a library which is linked to final application, but not called in application.
How to remove these unused functions from final image ?
Hello,
The linker has --no_remove specified, which disables this feature.
https://developer.arm.com/documentation/102284/6-16-2LTS/armlink-Reference/Linker-Optimization-Features/Elimination-of-unused-sections
I recommend also adding --info unused to the linker command line.
Tried removing --no_remove from linker options but no change in final image, still it conatins unused functions.
Tried lisiting --info unused in linker options, but no prints of removing unused code.
The smallest entity that can be removed is an ELF section. Are these unused functions in the same section as a used function?
The fromelf (with -c) utility can help you decipher this if you are unsure.
It shows there are 13 sections using fromelf -c. This includes code section, data rw, stack,
Is the "unused" code in the same section as "used" code? If so, then the linker cannot remove it.