ARM Technical Support Knowledge Articles

PUTTING INITIALIZED VARIABLES IN XDATA

Applies to: C166 C Compiler

Answer

Information in this article applies to:


SYMPTOMS

I have a very large program with many large, initialized variables. When I build my project, I receive one of the following error messages:

*** ERROR 172 IN LINE 9 OF test.c: 'HDATA0': length exceeded: act=172032, max=65536
Error 106: Section Overflow
Section: ?C_INITSEC

CAUSE

This error occurs because the section used to initialize global variables is overflowing. The following example program demonstrates this error.

int big_array1 [0x7000] = { 1, 2, 3, 4, };
int big_array2 [0x7000] = { 1, 2, 3, 4, };
int big_array3 [0x7000] = { 1, 2, 3, 4, };

void main (void)
{
}

RESOLUTION

The best solution is to place some of your variables in XDATA by using the XHUGE memory type when you declare the variable. For example:

int xhuge big_array1 [0x7000] = { 1, 2, 3, 4, };
int xhuge big_array2 [0x7000] = { 1, 2, 3, 4, };
int xhuge big_array3 [0x7000] = { 1, 2, 3, 4, };

void main (void)
{
}

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-07-15 13:00:26

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