ARM Technical Support Knowledge Articles

VARIABLE INITIALIZATION HALTS PROGRAM EXECUTION

Applies to: General Topics

Answer


Information in this article applies to:


QUESTION

I have a complex project setup and my variable initialization seems to stop in the middle of my application. It seems that the initialization table end marker is incorrectly located and therefore the initialization is not fully executed.

I have also stated the C compiler run-time libraries in my project setup. When I take this out, my program runs. What is the reason for the behavior?

ANSWER

The linker invocation list is derived from the uVision project file list. When you state the run-time libraries in your project list, you must ensure that this is the last input file for the linker.

The C compiler run-time library contains the end marker for the variable initialization table. The linker then adds the modules in the same sequence stated in the project list. Therefore, if the library is added in the middle of your module list, then the variable end table marker is in the middle of the initialization table.

Keil recommends that you NOT add the C run-time library, since the linker automatically detects the required library and adds it as last file to the input module list.

Article last edited on: 2004-04-15 13:03:23

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