Parsing a map file for variable addresses

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parsing a map file for variable addresses

Jump to solution
3,689 Views
atmosphere
Contributor I
Hi,
 
I'm doing some research on whether a simple way exists to extract variable memory addresses from a linkers output files. I was thinking of writing my own parser to extract the information from the .map file generated by the linker but was also hoping that an API exists which can do the job for me. The reason for this is that I want to build in functionality into a test application I'm writing to retrieve global variable values of specific addresses on my target system (kind of like μC/Probe does).
 
Has anyone here come accross a similar problem and if so how did you solve it? I'm using Codewarrior 8 v3.1.
 
Thanks
Labels (1)
Tags (1)
0 Kudos
1 Solution
1,045 Views
CrasyCat
Specialist III
Hello
 
Just my 10 cents on this one.
 
Why do you want to extract that data from the .map file.
The .map file is a text file generated for information purpose only. Its format may change in the future, so I would not recommend using that file to extract information.
 
Why not using the executable file (.abs) generated by the linker?
This file follows the ELF V1.1 standard and you should be able to retrieve the address from any symbol from the symbol table.
 
You can find information on ELF file format on the web, just google for it. THere is even an associated article on wikipedia http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
 
I hope this helps.
 
CrasyCat

View solution in original post

0 Kudos
1 Reply
1,046 Views
CrasyCat
Specialist III
Hello
 
Just my 10 cents on this one.
 
Why do you want to extract that data from the .map file.
The .map file is a text file generated for information purpose only. Its format may change in the future, so I would not recommend using that file to extract information.
 
Why not using the executable file (.abs) generated by the linker?
This file follows the ELF V1.1 standard and you should be able to retrieve the address from any symbol from the symbol table.
 
You can find information on ELF file format on the web, just google for it. THere is even an associated article on wikipedia http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
 
I hope this helps.
 
CrasyCat
0 Kudos