5.5 How to find the location of a symbol within the map file

To find the location of a symbol within the map file you must find the section that defines the symbol, and ensure that the linker has not removed the section.

To find the location of a symbol within the map file, use the --keep=section_id and --map options to view the image memory map. For example, if object(section) is the section containing the symbol, enter:

armlink --keep=object(section) --map s.o --output=s.axf

The memory map shows where the section containing the symbol is placed.

As an example, do the following:

Procedure

  1. Create the file s.c containing the following source code:
    long long altstack[10] __attribute__ ((section ("STACK"), zero_init));
    int main(void)
    {
        return sizeof(altstack);
    }
  2. Compile the source:

    armcc -c s.c -o s.o

  3. Link the object s.o, keeping the STACK symbol and displaying the image memory map:

    armlink --keep=s.o(STACK) --map s.o --output=s.axf

  4. Locate the STACK symbol in the output, for example:
    …
    Execution Region ER_RW (…)
    **** No section assigned to this execution region ****
    Execution Region ER_ZI (…)
    Base Addr    Size         Type   Attr      Idx    E Section Name        Object
    …
    0x00008228   0x00000050   Zero   RW            2    STACK               s.o

    This shows that the stack is placed in execution region ER_ZI.

Non-ConfidentialPDF file icon PDF versionARM DUI0474M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.