ARM Technical Support Knowledge Articles

MOVING THE STACK

Applies to: L251 Linker/Locator

Answer


Information in this article applies to:


QUESTION

I wish to locate the stack at 2000H. How do I do it?

ANSWER

You need to use the linker SEGMENTS directive as follows:

SEGMENTS(?STACK(2000H))

Note that the stack resides in the EDATA memory class; you must make sure that the address where you locate the stack is in EDATA. If not, then you may use the linker CLASSES directive to specify ranges of addresses to be in the EDATA class. For example:

CLASSES(EDATA(2000H - 21FFH))

Note that it is a bad idea to locate the stack in the middle of data segments. If the stack overflows or underflows, there is a higher chance of data being corrupted.

MORE INFORMATION

Article last edited on: 2005-07-15 13:16:03

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