[Question] why contains two gcc version in .comment of a ELF executable ?

Nick Clifton nickc@redhat.com
Mon Apr 24 10:43:00 GMT 2017


Hi Taeung,

>    $ readelf -p .comment /usr/local/lib/libmcount-fast.so
> 
>    String dump of section '.comment':
>      [     0]  GCC: (GNU) 7.0.1 20170405 (experimental)
>      [    29]  GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

Simply put - some parts of libmcount-fast.so were built with gcc 7.0.1
and other parts were built with gcc 5.4.0.  In both cases the version of
gcc used to build those parts was recorded in the binary, in a special 
section called .comment.  When these parts were linked together to form 
libmcount-fast.so the strings were concatenated, and hence you get the
results you describe above.

Cheers
  Nick



More information about the Binutils mailing list