There is something weird in your link editor command:
- You pass the
-sharedoption, requesting to create a shared library
- This means you have ticked the “Shared” box in Properties >> C/C++ Build >> Settings >> MCU GCC Linker >> Shared library settings
- The name you give to the artifact to generate (-+libImportedProject.elf+-) is effectively the name one would expect for a shared library
However this has no chance to work... Shared libraries are not supported on a bare machine and there is no ABI for shared libraries on the Cortex-M processors, so they will never work out-of-the-box.
This does not mean creating shared libraries in this context is impossible, but you’re on your own and have to define the ABI (call conventions, link process, etc.) and provide the appropriate support code (in your application) and link editor script (at least...)
If you just keep the project as generated by CubeMX (that is without this weird option, that needs this
.rel.plt section) it compiles like a charm.