How can I get nm to display the return types of a function?

I am trying to write a script to create a "fake" version of a huge and dirty code library, I thought that using "nm" in binary format and filtering can only be text characters, but I can not get nm to display the return type of the function, as well as the signature.

Thank you very much in advance.

+4
source share
1 answer

The return type of the function is not part of mangling. Return types are applied by the compiler directly based on type rules.

You can call a function defined as, for example, returning int , and with a declaration for returning, for example, char . Most tools will not notice inconsistencies. Considering everything they do, you can shoot in the foot, it’s not so bad as you have to go out of your way to do this. For example, without using a header file common to both modules.

+3
source

All Articles