Is there any way to read from compiled code what CCFLAGS (particularly the optimizations) were set at compile time?
-
I think your question is a duplicate of stackoverflow.com/questions/2387040/… but given it's on a different SE site I can't report it through the "flag" button.– ShadokCommented Feb 21, 2013 at 13:49
-
@Shadok almost what he wants: your link refers to reading the GCC version, the asker wants to know if he can find the CFLAGS used for building the binary.– RenanCommented Feb 21, 2013 at 13:57
-
1Sorry I think I swapped two links, here the one I wanted to link: stackoverflow.com/questions/189350/…– ShadokCommented Feb 21, 2013 at 14:16
-
1Thanks Shadok - if you add this as an answer I'll accept it. In my case the code was compiled with gcc 4.5 :) but the binary in question has been stripped :(– symcbeanCommented Feb 21, 2013 at 22:56
Add a comment
|
1 Answer
Apparently there is but only with gcc >= 4.3,the switch -frecord-gcc-switches
causes the whole command line to be put into ASCII commentaries.
See here for an answer to this question on SO.