ARMLINK: L6286E Relocation ... With Respect to ... Out of Range
Information in this knowledgebase article applies to:
In MDK-ARM, an L6286E error can be reported without any indication
of which module caused the error.
Receiving an L6286E error without module information
This can be caused by an embedded assembly code instruction that
tries to access a symbol that is beyond the range of the
Locating the Error Module
Use the linker option --trace r with --list
option in the linker command line to find the relocation causing
the error. To enter the linker option, go to Options for
Target, Linker tab, and enter the option in the Misc
controls box. The --list option will write the
relocation data to the map file.
When examining the map file, the last relocation listed is the
one causing the error and it will identify the object module
causing the error. Note the relocation type for use in the next
step. An example of a relocation type is:
Locating the Instruction Causing the Error
Once you've got the relocation (and the object containing it) you
should be able to find the symbol that was being referenced by using
Enter fromelf -crs in the window labeled Run user
programs before build/rebuild on the Options for Target,
User tab. You may have to do two builds, one to generate the
object file and one to run the fromelf utility on that
object file. (The Run user programs after build/rebuild is
not active unless there are no errors in the build.) The
fromelf syntax is as follows:
fromelf -crs -o "[path to output text file]\[output text file name]"
"[path to object file containing the error]\[filename].o"
Examine the fromelf output text file to find a
relocation that corresponds to the relocation type noted above.
Note the offset of the relocation, the section it refers to, and
the symbol name associated with the relocation.
Go to the listing for that section (in the same output file)
and look for the line number corresponding to the offset. That
should give you the instruction causing the error.
Go back to the source code for the module causing the error and
look for that instruction and the associated symbol. An example of
an instruction that could cause an error follows:
LDR R0, __cpp(symbol name)
To resolve this specific error, make this a pseudo instruction
that allows the entire memory range to be accessed as shown below:
LDR R0, =__cpp(symbol name)
Please search for L6286E in our
Error and Warning Reference Guide to get a list of possible
reasons for this warning.
Last Reviewed: Monday, February 4, 2019