ARM Technical Support Knowledge Articles

AVOIDING FUNCTION POINTER PROBLEMS WITH NOOVERLAY

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


QUESTION

I read Application Note 129 dealing with function pointers and have a question that is not explicitly answered within the app note.

All of the problems that are associated with function pointers seem to do with the data overlaying techniques used by the linker and the way arguments are passed. The app note states several times that the overlay directive may be used to "fix" the call tree that may not be correct when function pointers are used. If we use the NOOVERLAY directive, will all of these problems go away?

We are using the large memory model and have a relative overabundance of RAM. With RAM usage being a non-issue for us, and function pointers being of great importance, we are inclined to use the NOOVERLAY directive. We ran several test that indicate that this will work, but would like confirmation that there are not other side effects to disabling data overlaying.

ANSWER

There are no side effects from using NOOVERLAY and this will take care of the call tree analysis problem.

However, accessing variables in xdata is around 7 times slower than accessing variables in data memory. In addition, using the large memory model increases the size of your code and slows down execution. So the ideal solution is to use the small memory model, locate specific variables in xdata and fix the call tree for your indirect function calls.

MORE INFORMATION

SEE ALSO

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

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