This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Question] why contains two gcc version in .comment of a ELF executable ?
- From: Nick Clifton <nickc at redhat dot com>
- To: Taeung Song <treeze dot taeung at gmail dot com>, binutils at sourceware dot org
- Date: Mon, 24 Apr 2017 11:43:51 +0100
- Subject: Re: [Question] why contains two gcc version in .comment of a ELF executable ?
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9FB1551453
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9FB1551453
- References: <09cf575c-f2d1-2abd-9365-597bc99d9ef1@gmail.com>
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