Detect GCC compile-time flags of a binary

前端 未结 4 2037
谎友^
谎友^ 2020-11-30 08:42

Is there a way to find out what gcc flags a particular binary was compiled with?

4条回答
  •  我在风中等你
    2020-11-30 09:35

    I don't think so.

    You can see if it has debug symbols, which means -g was used ;) But I can't think of any way how you could find out which directories have been used to search for include headers for example.

    Maybe a better answer is possible if you only target for a specific flag; e.g. if you only want to know if the flag "..." was set when this binary was compiled or not. In that case, what flag would this be?

提交回复
热议问题