From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by sourceware.org (Postfix) with ESMTPS id 148A73858010 for ; Mon, 23 May 2022 11:26:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 148A73858010 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f44.google.com with SMTP id s3so18655275edr.9 for ; Mon, 23 May 2022 04:26:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=U7MZr/DmmvZsxSnpi+2QLW///cRIB/Bz12SWJl7F1Oo=; b=iDtmHDdkC9L9v2xu99A4xx6hcaalDhfXtOtrAe/EQ3Vwk/uCcCeVeIhlv6HjuFr6Z0 iriPc9yKFAn6K1m5cTWCn7HHxdpiI7q+T5iAb9v69Ux7mhBezS32oCCPb7KqjkfwfyXf 15aTwvqJQ6dSYdzHNAGU3lhYWBzVBxF02LQHlYPrFVi9aLKqxDkiB++cW1O5jO9iE/cy ict/Qn2xkbOK8KLkFMwP4rm3AymiXvZlvmqjWE/VhL+7GRoalL8Jcv/z4MgHISubAy4V InIwd/ncRtB2DEH1hOFMocMeXwRvMjGJmJNAfnqqs49VN71DXExDGnj4r3Hx2Xwq8i3I lzQA== X-Gm-Message-State: AOAM5319XFEU5BJUnt9c0N1mZuLFREqpQt22CNnUb6hc8BaN+Eq7p7zj 1teg+HCDfIThpBLoVXl8LjK/lOJdexvnFQ== X-Google-Smtp-Source: ABdhPJzQQ58sILaZWfBKW+zUYvHniT5UjKwXiVaucjtVMXfg2Cdc6nab0ksEctOw3Sn8d6b3hVcZ+g== X-Received: by 2002:a50:935c:0:b0:42a:befe:f767 with SMTP id n28-20020a50935c000000b0042abefef767mr23247204eda.428.1653305203690; Mon, 23 May 2022 04:26:43 -0700 (PDT) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id z8-20020a1709060ac800b006fec5cef701sm1983348ejf.197.2022.05.23.04.26.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 May 2022 04:26:43 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id y13so27380343eje.2 for ; Mon, 23 May 2022 04:26:43 -0700 (PDT) X-Received: by 2002:a17:907:96a4:b0:6fe:f4dc:8fe5 with SMTP id hd36-20020a17090796a400b006fef4dc8fe5mr1980512ejc.504.1653305203286; Mon, 23 May 2022 04:26:43 -0700 (PDT) MIME-Version: 1.0 References: <20220515191846.114257-1-luca.boccassi@gmail.com> In-Reply-To: <20220515191846.114257-1-luca.boccassi@gmail.com> From: Luca Boccassi Date: Mon, 23 May 2022 12:26:31 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ld: add --package-metadata To: binutils@sourceware.org, Nick Clifton Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2022 11:26:50 -0000 On Sun, 15 May 2022 at 20:21, wrote: > > From: Luca Boccassi > > Generate a .note.package FDO package metadata ELF note, following > the spec: https://systemd.io/COREDUMP_PACKAGE_METADATA/ > > If the jansson library is available at build time (and not explicitly > disabled), link ld to it, and use it to validate that the input is > correct JSON, to avoid writing garbage to the file. > If no configure option is passed and jansson (or pkg-config) is not > found, then it is just skipped (with a non-fatal warning). The > configure option --enable-jansson can be used to explicitly enable it > (error out when not found) or to explicitly disable it (don't even > look for it). This allows bootstrappers (or others who are not > interested) to seamlessly skip it without issues." > --- > Now that this spec has shipped for all packages in Fedora 36, it seems > like a good time to add a specific option for it to the default linker. > Follows the same pattern of --build-id. > I've added an optional usage of libjansson to provide additional validation, > so that it doesn't have to be reimplemented everywhere a thousand times over. > For bootstrapping purposes the dep is optional and can be skipped, for example > in Debian/Ubuntu it would be annotated with so that everything > works out of the box. > > bfd/elf-bfd.h | 8 ++ > bfd/elf.c | 6 +- > ld/Makefile.am | 6 +- > ld/configure.ac | 35 ++++++++ > ld/emultempl/elf.em | 9 ++ > ld/ld.texi | 7 ++ > ld/ldelf.c | 121 ++++++++++++++++++++++++++- > ld/ldelf.h | 2 + > ld/lexsup.c | 2 + > ld/testsuite/ld-elf/package-note.exp | 49 +++++++++++ > ld/testsuite/ld-elf/package-note.rd | 6 ++ > 11 files changed, 244 insertions(+), 7 deletions(-) > create mode 100644 ld/testsuite/ld-elf/package-note.exp > create mode 100644 ld/testsuite/ld-elf/package-note.rd Hi Nick, Did you have any chance to look at this? Any thoughts? Thanks! Kind regards, Luca Boccassi