bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/30187] New: ld.bfd and ld.gold versions in .comment section of


From: tkacvins at gmail dot com
Subject: [Bug gold/30187] New: ld.bfd and ld.gold versions in .comment section of ELF files
Date: Wed, 01 Mar 2023 15:13:26 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=30187

            Bug ID: 30187
           Summary: ld.bfd and ld.gold versions in .comment section of ELF
                    files
           Product: binutils
           Version: 2.39
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: tkacvins at gmail dot com
                CC: ian at airs dot com
  Target Milestone: ---

Using a simple "hello world!" program

#include <stdio.h>

int main(int argc, char** argv)
{
   printf("Hello world!\n");
   return 0;
}

and then compiling with GCC 12.1 (or any GCC that supports -fuse-ld=gold)

gcc -fuse-ld=gold hello.c

Results in the ld.gold version not being in the .comment section.  Ditto if one
uses ld.bfd.

However, if one uses a GCC that supports -fuse-ld=lld, one gets a linker
version in the .comment section

gcc -B /opt/lld-14.0.6/bin -fuse-ld=lld hello.c

$ readelf -p .comment a.out

 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

It would be nice if the gold and bfd linkers emitted their version into the
.comment section.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]