Keil Logo

ARMLINK: L6286E Relocation ... With Respect to ... Out of Range


Information in this knowledgebase article applies to:

  • MDK_ARM V4.60 and later

PROBLEM

In MDK-ARM, an L6286E error can be reported without any indication of which module caused the error.

SYMPTOM

Receiving an L6286E error without module information

CAUSE

This can be caused by an embedded assembly code instruction that tries to access a symbol that is beyond the range of the instruction.

RESOLUTION

Locating the Error Module

  1. 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.
  2. 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:
    R_ARM_THM_PC12
    

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 fromelf.

  1. 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"
    
  2. 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.
  3. 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.
  4. 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)
    
  5. 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.

MORE INFORMATION

Last Reviewed: Monday, February 4, 2019


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.