ARM Technical Support Knowledge Articles

DATA MEMORY OVERLAP WHEN USING PRECEDE DIRECTIVE

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


SYMPTOMS

When I add printf() to my project, I get a Memory Overlap Error from the linker for the Data space. Part of my map file looks like the following:

            TYPE    BASE      LENGTH    RELOCATION   SEGMENT NAME
            -----------------------------------------------------

            * * * * * * *   D A T A   M E M O R Y   * * * * * * *
            ...
            DATA    0018H     0024H     UNIT         _DATA_GROUP_
* OVERLAP * DATA    0028H     0002H     UNIT         ?DT?EVL_INIT
            DATA    003CH     0010H     UNIT         ?DT?DEMO1
                    004CH     0024H                  *** GAP ***
            ...

The segment ?DT?EVL_INIT is located at 0028H with the linker DATA directive. The linker PRECEDE directive is used with the _DATA_GROUP_ segment.

CAUSE

When you added the printf() call, the size of the _DATA_GROUP_ segment increased in size to the point where it could not fit into Data memory before the ?DT?EVL_INIT segment. When the linker tried to place the ?DT?EVL_INIT segment into memory, it failed because part of that space was already taken by the Data Group. The reason the _DATA_GROUP_ segment was located before the ?DT_EVL_INIT segment was because the PRECEDE directive is used.

RESOLUTION

Remove _DATA_GROUP_ from the PRECEDE directive so the linker can fit the Data Group into Data memory after locating the ?DT?EVL_INIT segment. This gives the linker the greatest flexibility in locating the segments.

If it is not possible to remove _DATA_GROUP_ from the PRECEDE directive, then the DATA directive must be used to juggle the segments around so they can all fit into Data memory.

MORE INFORMATION

Article last edited on: 2005-07-19 10:04:25

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