Fix Unexpected Undefined Symbol
The ARM linker requires to resolve all symbols before detecting some that are not transitively required for linking the Executable.
This typically happen when linking ELF object files containing dead code or debug functions that are compiled but not intended to be linked.
If such functions refer to unresolved symbols, you may need to define a fake symbol to make the linker happy.
You can declare it in your BSP project or directly in your VEE Port as following:
Create a file
link/armlink-weak.lscf in the dropins directory of your VEE Port configuration project.
Edit the file and declare as many symbols as required. See also the MicroEJ Linker chapter for more details on the MicroEJ linker file syntax.
<defSymbol name="[symbolName]" value="0" rootSymbol="true" weak="true"/>
The weak symbol(s) will be directly defined in the application object file (
Link the SOAR Debug Section
When building an Application, the SOAR generates a dedicated ELF debug section named
.debug.soar in the application object file (
This section is used by debug tools such as the Stack Trace Reader or the Heap Dumper.
It is also used by the SOAR itself for building Features on a Kernel.
Unfortunately, the ARM linker does not link this section in the output ELF executable, even with debug mode enabled.
If you try to load the raw executable produced by the ARM linker, the tools will fail with a no debug section error.
Here is an example with the Stack Trace Reader:
=============== [ MicroEJ Core Engine Trace ] ===============
[INFO] Paste the MicroEJ core engine stack trace here.
1 : PROXY ERROR
[M8] - The file XXX is not a valid image file or has no debug informations (can't read file: XXX (no debug section)).
To be able to use debug tools, the debug section must be manually linked and injected in the Executable.
This is done using the SOAR debug infos post-linker tool.
SOAR debug infos post-linker tool Selection
This tool takes two file options:
soar.object.file: the internal object file produced by the SOAR when building the Application. It can be found in the Launch Output Folder at
output.executable.file: the Executable file produced by the ARM linker that includes the linked Application.
SOAR debug infos post-linker tool Configuration
Once executed, it produces a new Executable file beside the original one with the
.microej extension suffix
=============== [ SOARDebugInfosPostLinker ] ===============
Successfully generated c:\myExecutable.axf.microej.
This file now contains the linked
.debug.soar section so that it can be used by the debug tools.