Take a look at the following commmand line:
gcc -o hello -Wall -D_BSD_SOURCE hello-world.c
Now, is there a way to know about these options by doing some processing on the 'hello' executable.
thanks.
|
|
|
Sadly, no. But if you think about it before you create a binary, there are some ways. Here's another. With recent gcc, you can use -frecord-gcc-switches option which will add one section to the ELF file with the description you are seeking.
As you can see it shows you all used options, not just those you provided explicitly. |
|||
|
|
|
Impossible, but compiler version might be available if you didn't strip the binary. If you refer to the macro stuff, i.e |
|||
|
|
|
No way, but if you use Makefile, there's a way:
|
|||
|
|