This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What do N/A (command line) and N/A (alignment) Represent in an IAR for MSP430 MAP File?



Note this question is related to, but more specific than:

IAR Map File

IAR Map file Interpretation

What do Shared and Common Memory Represent in an IAR for MSP430 MAP File?

In my IAR map file I have the following lines:

Module                 CODE      DATA       CONST
------                 ----      ----       -----
                      (Rel)  (Rel)  (Abs)   (Rel)

...

N/A (command line)           1 360
N/A (alignment)

What do these sections represent? I'm most concerned with N/A (command line) which is using more than 1K of data memory.

  • I found the answer to part of my question while gathering the details of the post.

    The data reserved for N/A (command line) is the data specified at the command line for the stack, e.g. -D_STACK_SIZE=550. 550 hex = 1360 decimal.

    I also see

    _STACK_SIZE             0550

    and

    CSTACK                                 3EB0 - 43FF             550   rel    1

    in the map file which confirms this.

    I assume that N/A alignment is memory that is "lost" because of variable alignment padding. Surprised that I have zero though for this, maybe it means something else?

    I've looked in the IAR Compiler Reference Manual and also in the Help Guide but couldn't find the answer.

  • N/A means ‘not available’ and tells you that the given data amount is not directly related to a module (hence the N/A in the module name column)

    As you found out yourself, “(command line)” counts data that is introduced by command line switches rather than code modules.
    “(alignment)” likely refers to fill data (wasted space) that is introduced due to misalignment of code modules (e.g. code with an odd number of bytes due to include constant byte data, requiring a padding byte) or data (e.g. packed structures or arrays with an odd number of bytes in size). Normally, code is already even size and structs are padded to even size by the compiler (so the linker won’t count the padding bytes as alignment loss). However, having something like
    int data1;
    Unsigned char data2[13];
    Int data3;
    might result in one byte lost for padding between data2 and data3. It likely depends on how much the linker can re-arrange.

**Attention** This is a public forum