documentation needed about .xmap file

cancel
Showing results for 
Search instead for 
Did you mean: 

documentation needed about .xmap file

4,085 Views
vale
Contributor I
Hallo,
could anyone tell me where I can find some documentation about how to interpretate
.xmap files produced by the CodeWarrior linker when the target board is a Coldfire M52235?
I would like to understand the content of such files...
 
Thank you
Valentina
Labels (1)
0 Kudos
3 Replies

426 Views
CrasyCat
Specialist III
Hello
There is no such documentation available as far as I know, but the content of the .xmap file is pretty straight forward.
 
It indicates you where each object (function, variable, constant, ..) has been allocated as well as the size of each object.
For instance:
  00000500 00000028 .text   setupTime (timer.c)
tells the function setupTime is allocated at address 0x500 and its size  is 0x28 bytes.
You also see that the function is implemented in module timer.c
Finally there is a summary of the application memory map, showing where you have data and code allocated.
 
 # Memory map:
  v_addr      p_addr      size            name
  00000500 00000500 00009098 .main_application TEXT
  00009598 00009598 000053F0 .main_application_data DATA
Is there anything I missed?
 
CrasyCat
0 Kudos

426 Views
vale
Contributor I
Thank you very much for your help.
 
There are some doubts left which maybe you  can answer:
 
1) Find below some lines of my .ROM.elf.xmap file obtained after compiling with CodeWarrior.
   I was wondering why some functions are allocated (there is an address in memory) but have no size...
 
2) Why are some variables (indicated as ".rodata") described with the notation @number...what is the meaning of such number?
 
3) In the summary of the application memory map, there is a distinction between v_address (virtual memory addres, I suppose) and p_address (physical memory address, I suppose). Can you explain me this difference for Coldfire MCF52235? Or alternatively, can you suggest an appropriate document reference to understand such distinction?
 
Thank you for any help,
Valentina
 
 
00000410 00000020 .text   main (main.c)
 00000430 0000049C .text   mcf5xxx_exception_handler (mcf5xxx.c)
 000008CC 0000005C .text   uart_getchar (uart.c)
 00000928 00000060 .text   uart_putchar (uart.c)
 00000988 0000000C .text   InitializeUART (UART_unity.c)
 00000994 00000054 .text   ReadUARTN (UART_unity.c)
 000009E8 00000050 .text   WriteUARTN (UART_unity.c)
 00000A38 00000000 .text   asm_exception_handler (mcf5xxx_lo.s)
 00000A38 00000000 .text   asm_exception_handler (mcf5xxx_lo.s)
 00000A38 00000198 .text   @DummyFn1 (mcf5xxx_lo.s)
 00000A38 00000198 .text   .text (mcf5xxx_lo.s)
 00000A5A 00000000 .text   asm_set_ipl (mcf5xxx_lo.s)
 00000A5A 00000000 .text   asm_set_ipl (mcf5xxx_lo.s)
 00000A90 00000000 .text   mcf5xxx_exe_wdebug (mcf5xxx_lo.s)
 00000A90 00000000 .text   mcf5xxx_exe_wdebug (mcf5xxx_lo.s)
 00000A9A 00000000 .text   mcf5xxx_wr_sr (mcf5xxx_lo.s)
 00000A9A 00000000 .text   mcf5xxx_wr_sr (mcf5xxx_lo.s)
 00000AA2 00000000 .text   mcf5xxx_wr_cacr (mcf5xxx_lo.s)
 00000AA2 00000000 .text   mcf5xxx_wr_cacr (mcf5xxx_lo.s)
 00000AAE 00000000 .text   mcf5xxx_wr_asid (mcf5xxx_lo.s)
.......
 00003214 0000001C .rodata @113 (mcf5xxx.c)
 00003230 00000018 .rodata @114 (mcf5xxx.c)
 00003248 0000002A .rodata @115 (mcf5xxx.c)
 00003272 00000017 .rodata @116 (mcf5xxx.c)
 0000328A 00000020 .rodata @117 (mcf5xxx.c)
 000032AA 0000000E .rodata @118 (mcf5xxx.c)
 000032B8 00000014 .rodata @119 (mcf5xxx.c)
 000032CC 00000014 .rodata @120 (mcf5xxx.c)
 000032E0 00000010 .rodata @121 (mcf5xxx.c)
 000032F0 00000021 .rodata @122 (mcf5xxx.c)
 00003312 00000021 .rodata @123 (mcf5xxx.c)
..........
 
0 Kudos

426 Views
CrasyCat
Specialist III
Hello
 
>1) Find below some lines of my .ROM.elf.xmap file obtained after compiling with CodeWarrior.
>   I was wondering why some functions are allocated (there is an address in memory) but have no size...
 
Function having a size of 0 are functions, which are not part of the image. They have been removed from the application as they are not used (linker is performing  dead stripping).
 
>2) Why are some variables (indicated as ".rodata" described with the notation @number...
>    what is the meaning of such number?
 
  The constants @xxxx are constants generated internally by the compiler. Compiler might generate such constants while optimizing code. For instance jump addresses in a switch block. You do not have to care about them If they are linked to your application, they are needed.
 
>3) In the summary of the application memory map, there is a distinction between v_address (virtual
> memory address, I suppose) and p_address (physical memory address, I suppose). Can you explain
>me this difference for Coldfire MCF52235? Or alternatively, can you suggest an appropriate document
> reference to understand such distinction?
 
v_addr stands for virtual address , p_addr stands for physical address.
Usually p_addr is similar to v_addr. Only case where they can differ is if you decide to copy data (or code) from ROM to RAM at startup. If you wish to do that you have to adjust your .lcf file.
If you are using CodeWarrrior for Coldfire V6.3, refer to {Install\Help\PDF\ColdFire_Build_Tools_Reference.pdf, Chapter "Coldfire Linker", section "LCF Syntax" -> "ROM-RAM Copying" for more information.
 
CrasyCat
0 Kudos