问题
How can I tell if a certain c++ library was linked using c++11 standard?
回答1:
An elf binary would by default contain the signature of compiler version used.
Now, with regards to compiler flags used, If -frecord-gcc-switches is used at compile time, then, you can find the signature in ELF executable.
g++ -frecord-gcc-switches -std=c++0x trial.cpp
readelf -p .GCC.command.line a.out
String dump of section '.GCC.command.line':
[ 0] -imultilib . [ d] -imultiarch x86_64-linux-gnu [ 2a] -D_GNU_SOURCE [ 38] trial.cpp [ 42] -mtune=generic [ 51] -march=x86-64 [ 5f] -std=c++0x [ 6a] -frecord-gcc-switches [ 80]
-fstack-protector
来源:https://stackoverflow.com/questions/33407016/how-to-tell-a-library-was-compiled-using-c11