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

Taeung Song treeze.taeung@gmail.com
Mon Apr 24 07:18:00 GMT 2017


Hi all,

I think this may be newbie question.
But I wonder the reason of below case.
I'd appreciate it, if you explain the reason. :)

   $ 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



If I detailedly describe current situation,
my default gcc version is 5.4.0

   $ gcc --version | head -1
   gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

but I used gcc 7.0.1 that I manually built with recent source code
instead of gcc 5.4.0.

   $ gcc --version | head -1
   gcc (GCC) 7.0.1 20170405 (experimental)

And then I built a library by gcc 7,
so I found the above result from "readelf -p .comment".
Could I know the reason ?


Thanks,
Taeung



More information about the Binutils mailing list