Common Issues
- plugin needed to handle lto object
When processing LTO object files, the linker or related toolchain needs to call the LTO plug-in to parse the corresponding section information. This error generally occurs because ar, ranlib, or nm does not call the LTO plug-in, which can be resolved by replacing it with gcc-ar, gcc-ranlib, or gcc-nm.
- undefined symbol
There are many causes of this issue. The following lists three common causes:
Symbol version control: GCC does not support symbol version control in __asm__ format. Therefore, you need to replace it with symbol version control in __attribute__(.symver) format at the application source code level.
Incompatible tools: Tools like objcopy may not fully support LTO object files. This can lead to issues with symbol renaming and result in undefined symbol errors.
Link-time instrumentation: Using -Wl,--wrap=foo with LTO might lead to an undefined symbol error for __wrap_foo. This is a known issue being addressed upstream.
- multi-defined symbol
This issue is often caused by tools like objcopy that lack full LTO support. Symbols intended to be hidden might not be properly handled, leading to multiple definitions.