Keil™, An ARM® Company

Technical Support

BL51: ERROR L107 (ADDRESS SPACE OVERFLOW) WITH INLINE ASM


Information in this article applies to:

  • BL51 All Versions

QUESTION

I want to use inline assembly code in a large C module. When I add a single line of assembly code and set the Generate Assembler SRC File and Assemble SRC File options for the C module, I receive the following linker error message:

*** ERROR L107: ADDRESS SPACE OVERFLOW
    SPACE:   XDATA
    SEGMENT: ?XD?MY_FUNCTION?MAIN
    LENGTH:  0018H

The inline assembly should only increase my code size by 2 bytes and shouldn't affect XDATA at all. Why do I get this error?

ANSWER

Your XDATA variables are not overlaying. When you use assembly source files, the linker requires at least one C source file in your project that is directly compiled into an object file to enable data overlaying. This can be an empty C source file.

The preferred way to do this is to move the functions that require inline assembly to a separate C module, then create an assembly SRC file from that. The C module that contains no inline code satifies the C module requirement and separating the inline functions into an "inline" module helps document what you've done.

MORE INFORMATION

SEE ALSO

Last Reviewed: Wednesday, March 09, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure