Assume that you have a static library built with gcc by another person and you want to find out the version number of gcc that was used for compiling. Is there an easy way to extract this information from the library file?
I already tried out readelf, but all the switches I've used so far did not lead to a gcc version number.
This gets recorded in DW_AT_producer attribute in DWARF debug info. So if you have debug info, try this:
objdump -Wi yourlibrary.a|grep "DW_AT_producer"
I didn't see any official documentation for this attribute, so you might have to check...
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