I have been searching quite a lot, but haven't found a way to extract function prototype, atleast the argument types and return type from an ELF executable file. Using GNU BinUtils or any other method.
I have tried using different options in readelf, nm and objdump, they list the symbols and function names, but how to know a function's argument types and return type?
I have a gut feeling that there should be a way to do it, can anyone throw some light on this?
Host: Windows 7
Target: elf for PowerPC architecture
Assuming your binary was built with debug info, you can get function type, argument types, etc. etc. by reading DWARF debug format, which readelf -wi
will dump.
If your binary was produced by IBM's compiler, it may have (older) STABS debug info instead, which you can dump with objdump -g
.
If your binary does not have the debug info, then you can't get the info you are looking for -- it's just not there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With