ARM Technical Support Knowledge Articles

LOCATING GROUPS OF CODE SEGMENTS TOGETHER

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


QUESTION

My CODE memory starts at 100H, however, I have a collection of USB functions that I wish to locate starting at 8000H. Is there any way to do this without specifying a starting address for every single function?

ANSWER

Yes. The following is an example which locates the USB functions usb_func1(), usb_func2() and usb_func3(), defined in the source file locate.c starting at 8000H:

CODE(?PR?USB_FUNC1?LOCATE(8000H), ?PR?USB_FUNC2?LOCATE, ?PR?USB_FUNC3?LOCATE, 100H)

The linker processes the arguments one at a time. It locates the first segment at address 8000H and from then on locates every specified segment sequentially in memory. It finally reaches the 100H and from that point onwards locates every other segment in the project sequentially in memory starting at that address.

The same technique can be used for multiple groups of segments. For example:

CODE(?PR?FUNC1?LOCATE(4000H),?PR?FUNC2?LOCATE,?PR?FUNC3?LOCATE(8000H),?PR?FUNC4?LOCATE,100H)

locates functions func1() and func2() starting at 4000H, functions func3() and func4() starting at 8000H, and the rest of the code segments starting at 100H.

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-07-15 12:53:59

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