ARM Technical Support Knowledge Articles

WARNING L16 (UNCALLED SEGMENT, IGNORED FOR OVERLAY)

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


QUESTION

My simple project has two modules, a C and an Assembly module. I am trying to call one of the C functions from within the assembly module, but each time I build the project I get:

 WARNING 16 : UNCALLED SEGMENT - IGNORED FOR OVERLAY PROCESS.

I have already checked the knowledgebase and have seen several articles relating to this warning, but they don't help. How do I fix this problem?

ANSWER

The following is a solution should accomplish what you are trying to do:


Test.c


void foo(void);    // C function declaration

extern void FOO_CALLER(void);  // referencing a function
                                                     // defined elsewhere - C style

void main(void)
{
   FOO_CALLER();

   while(1);
}

void foo(void)    // C function definition
{
}


Asm_Test.asm


NAME ASMTEST       ; module name

EXTRN CODE (foo)    ; referencing a function defined
                                   ; elsewhere - assembly style

?PR?TSEG?ASM_TEST SEGMENT CODE
PUBLIC  FOO_CALLER     ; assembly routine declaration

RSEG ?PR?TSEG?ASM_TEST
using   0

FOO_CALLER:        ; assembly routine definition
        call foo

   RET
   END

CAUSE

The reason you may be receiving this warning is that although you have an assembly module that calls a C function, the assembly module itself is not being called by anything.

RESOLUTION

As illustrated above, you have to define a routine in your assembly module that calls the C function. The assembly routine in turn must be called from main or some other function that is called from main in C. Note that programs must have a "main" routine and in this example, the "main" routine is in the C module.

See the Attached Files section below to download an example project.

The actual code for the assembly module was generated using the SRC pragma.

MORE INFORMATION

SEE ALSO

ATTACHED FILES

Request the files attached to this knowledgebase article.

Article last edited on: 2007-11-16 15:30:21

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential