检测GCC编译时一个二进制的标志 [英] Detect GCC compile-time flags of a binary

查看:114
本文介绍了检测GCC编译时一个二进制的标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法找出什么GCC标志一个特定的二进制编译时?

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

推荐答案

一个快速浏览一下GCC文档不打开任何东西。

A quick look at the GCC documentation doesn't turn anything up.

升压家伙是一些最聪明的C ++开发人员那里,他们resort命名<一个href=\"http://www.boost.org/doc/libs/1%5F36%5F0/more/getting%5Fstarted/windows.html#library-naming\">conventions因为这通常不是可能的(可执行可能已经以任何数量的语言创建的,由任意数量的编译版本的,毕竟)任何其他方式。

The Boost guys are some of the smartest C++ developers out there, and they resort to naming conventions because this is generally not possible any other way (the executable could have been created in any number of languages, by any number of compiler versions, after all).


(由更晚):<一href=\"http://dberkholz.word$p$pss.com/2007/10/12/new-gcc-hotness/?referer=sphere%5Frelated%5Fcontent/\">Turns出GCC在4.3这个功能如果要求在编译code 为:

一个新的命令行开关-frecord-GCC开关...使被用来调用被记录到正在创建的目标文件编译器的命令行。该记录的具体格式是目标和二进制文件格式的依赖,但它通常需要包含ASCII文本的说明部分的形式。

A new command-line switch -frecord-gcc-switches ... causes the command line that was used to invoke the compiler to be recorded into the object file that is being created. The exact format of this recording is target and binary file format dependent, but it usually takes the form of a note section containing ASCII text.

这篇关于检测GCC编译时一个二进制的标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆