2

ELF binaries of Linux distributions are stripped and don't include ".comment" section. Therefore, I could not get the information which compiler build the ELF binary. I guess most of them are created by GCC and want to know which GCC version is used.

I know that if the ".comment" section is included in the ELF binary, I can get the compiler information using "readelf" or "objdump". The method was posted before at the stackoverflow.com

How to retrieve the GCC version used to compile a given ELF executable?

I guess I can use decompiling tools (e.g., Hex-Rays Decompiler https://www.hex-rays.com/products/decompiler/ ) to estimate the compiler version. I also want to know the compiler name if the binary is not created by GCC. For example LLVM-clang.

Do you know a tool to estimate the compiler name and version which create the ELF binary? I prefer to use a free tool.

langlauf.io
  • 3,009
  • 2
  • 28
  • 45
Kuniyasu Suzaki
  • 157
  • 2
  • 9

1 Answers1

1

ELF binaries of Linux distributions are stripped and don't include ".comment" section. Therefore, I could not get the information which compiler build the ELF binary.

Most binaries also come with a separate debuginfo package, which does have .comment sections, and full source package which allows you to configure and build (almost) identical binary.

Examining either the debuginfo, or the source package is a much easier and more reliable way to answer your question, then guessing from the binary will ever be.

Do you know a tool to estimate the compiler name and version which create the ELF binary?

I doubt such a tool exists: writing such a tool would be a mostly pointless exercise.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • *debuginfo* sounds interesting. I can download debuginfo using *debuginfo-insall* command. However, I can not understand how to use it. Please tell me how to know the compiler version from the *debuginfo*. – Kuniyasu Suzaki Dec 12 '17 at 04:58