Can I determine which compiler/linker flags where used to create a binary-only shared library?

后端 未结 2 665
借酒劲吻你
借酒劲吻你 2021-02-19 18:00

I am wondering if there is a way to find out which g++ compiler/linker flags where used in creating a binary-only library.

For example there might be a 3rd

相关标签:
2条回答
  • 2021-02-19 18:31

    There is no systematic way of doing this. You can look if the library is linked to libpthread as an indication of whether -pthreads was used. For PIC/non-PIC code, you may want to try this. Optimization level, tuning and others will be much harder to determine.

    0 讨论(0)
  • 2021-02-19 18:41

    I don't believe so as there does not appear to be a section in the ELF format for that information. On Linux, if you use 'readelf -a' to dump all the information, there's nothing about how the file got that way.

    0 讨论(0)
提交回复
热议问题