开发者

Map file with GCC on OSX

开发者 https://www.devze.com 2022-12-22 15:03 出处:网络
I am using GCC on Mac OSX. I am trying to get GCC to create a map(or listing) file of all the symbols in the project so it contains the addresses at which they are mapped.

I am using GCC on Mac OSX. I am trying to get GCC to create a map(or listing) file of all the symbols in the project so it contains the addresses at which they are mapped.

I read in the GCC manual that a way of generating such map files is to pass system specific flags to the GCC linker using -Xlinker option.

But I cannot find what the option itself is. Does anyone know if this is possible with usin开发者_如何学JAVAg GCC on OSX?


The ld option is -map. With -Xlinker you would write:

gcc -Xlinker -map -Xlinker /path/to/map ...

You can also write this more concisely with -Wl:

gcc -Wl,-map,/path/to/map ...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号