Hi Nick, On Wed, Mar 1, 2023 at 8:41 AM Nick Clifton wrote: > Hi Tom, > > > I have noticed that the LLVM linker will add something to the .comment > > section of binaries it produces for the version of lld used to produce an > > ELF executable or shared library. > > Does it ? I do not see this: > > % clang hello.c > % readelf -p.comment a.out > > String dump of section '.comment': > [ 0] GCC: (GNU) 12.2.1 20221121 (Red Hat 12.2.1-4) > [ 2e] GCC: (GNU) 12.0.1 20220413 (Red Hat 12.0.1-0) > [ 5c] clang version 14.0.5 (Fedora 14.0.5-2.fc36) > Ahh, sorry for the confusion. I am using GCC forcing the use of LLD $ /opt/gcc-12.1.0/bin/gcc -B /opt/lld-14.0.6/bin -fuse-ld=lld -o wchar wchar.c $ /opt/binutils-2.39/bin/readelf -p .comment wchar String dump of section '.comment': [ 0] GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-39) [ 2d] Linker: LLD 14.0.6 [ 40] GCC: (GNU) 12.1.0 > > So there is a note for the version of Clang, but not one for the version > of lld. > Maybe this is a new feature ? I am using clang/llvm/lld version 14.0.5. > > > > For the gold liker, I see I can do a readelf -p .note.gnu.gold-version > and > > get the version of gold used to make an ELF file. > > Again I do not see this: > > % gcc hello.c -fuse-ld=gold > % readelf -p.comment a.out > > The gold version is in a different section $ /opt/gcc-12.1.0/bin/gcc -B /opt/binutils-2.39/bin -fuse-ld=gold -o wchar wchar.c $ /opt/binutils-2.39/bin/readelf -p .note.gnu.gold-version wchar String dump of section '.note.gnu.gold-version': [ c] GNU [ 10] gold 1.16 String dump of section '.comment': > [ 1] GCC: (GNU) 12.2.1 20221121 (Red Hat 12.2.1-4) > [ 2f] GCC: (GNU) 12.0.1 20220413 (Red Hat 12.0.1-0) > > > I see nothing similar for the BFD linker. > > True - this feature is not currently supported. > > > So the request for enhancement is to add something to the .comment > section > > as to which version of the BFD or gold linker was used to produce the > ELF. > > > > I can file a BZ if that is the preferred way of receiving a request such > as > > this. > > It is, so please do file a BZ. If you can include a reproducer that would > help. > OK, I'll do so, with simple "hello world!" code and the commands I am using, as above. Thanks, Tom