From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id C3476383F419 for ; Wed, 1 Mar 2023 14:53:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3476383F419 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x230.google.com with SMTP id bg11so10950213oib.5 for ; Wed, 01 Mar 2023 06:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677682424; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=l5dfanvqcdi9HbH4zaaHZnc4sBAwmkMdN2ez4DcDzyI=; b=FhEcgiZI8rCF8BsTY/C7ie2HANeMkuVE247YjB+4qRNNOe0P1/uQ+pyoaYmhavm/d0 OVK1tue5joTO3JE5uA5ii6UkyDddt26fLxnsKWtmtAiH3a95k8/AVfuamuvl0/brYVfc nQtoK9jZUYZ9fsNNkwXZke+1bBj8Jderuz0kJAvaXFkwSzD5kWhGdLC7tJqkFaQGK7gM mS4wOgW6YfCm2r3t0aYwKU3a9bcVUH08LfJf6ksu5Rdft+g9CAyQWEKc8VJU7ToC2+7Y j51ufi7zKVTeU0EgK7U4ktf7r62e/c4BI+HmPkVyW3w34JEoBQ5ozkGtx4jGDBFIQCAw ZPXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677682424; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l5dfanvqcdi9HbH4zaaHZnc4sBAwmkMdN2ez4DcDzyI=; b=YM4whUPMgo0T1k8u/T42bsT+XV7Zkzc1YI9/E8YasLZP9JgBWzXIXHg90jbf66trfu kuz/USrkBGMbtzvYAY7z6rkIdc0UTy6fP6p7XsVus5E9U1PeJUC4ZswwndvassDCM25U Mggq8bCDXX8GKDiknNeqTUvTqcLYtEGl61dWN8JdMKvpeTnmFa/83QprWsTypbLm2xaN LiEwQOTbelx008FNj//J6q2SqZ+iWo7NOhHsrgy0EMiWCsyRfTIDSElCzvd4c5ErG2SX 4W01F842Mcs3RjG5kYAbs+yoFvbQkcJnJqDZukdX8iznTkZ3UfKbgxV1yi75M/U1mUGB 4KzQ== X-Gm-Message-State: AO0yUKVb4oQfJb0BI7EDitf5aAOimihSUAMeqm4nPU+lyejOJ9G4hMYG 7PkMEIcRJu+sNV7J+RuzAS62RH6CfeHHy4C1CIFjEDzoS34= X-Google-Smtp-Source: AK7set+8fKxnfst8WCOsZe+943jqLI4ApZCaBSgC1Yse1eyQ05nC1+FR3xswbztLsxlmWQBRrebDVU5JwiTNuGJmI2k= X-Received: by 2002:a05:6808:206:b0:384:1f5f:d19e with SMTP id l6-20020a056808020600b003841f5fd19emr2024467oie.0.1677682423969; Wed, 01 Mar 2023 06:53:43 -0800 (PST) MIME-Version: 1.0 References: <3ef565e0-011e-1ffd-cac6-04aa8f371537@redhat.com> In-Reply-To: <3ef565e0-011e-1ffd-cac6-04aa8f371537@redhat.com> From: Tom Kacvinsky Date: Wed, 1 Mar 2023 09:53:33 -0500 Message-ID: Subject: Re: request for enhancement in BFD and gold linkers in regards to .comment section To: Binutils Content-Type: multipart/alternative; boundary="000000000000ed3f4305f5d7e0e5" X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000ed3f4305f5d7e0e5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Nick, On Wed, Mar 1, 2023 at 8:41=E2=80=AFAM Nick Clifton wrot= e: > 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=3Dlld -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=3Dgold > % 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=3Dgold -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 --000000000000ed3f4305f5d7e0e5--