Parsing a map file for variable addresses

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Parsing a map file for variable addresses

跳至解决方案
4,005 次查看
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
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,361 次查看
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 项奖励
回复
1 回复
1,362 次查看
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 项奖励
回复