From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) by sourceware.org (Postfix) with ESMTPS id DB0353856DFB for ; Thu, 26 May 2022 10:46:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB0353856DFB 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-oi1-f173.google.com with SMTP id w130so1721523oig.0 for ; Thu, 26 May 2022 03:46:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version; bh=HahOOFgFRXcDvBzqGDmd5eHpkzxO8Lve/Wj0sCb6qqU=; b=esjlAjfpjNSsB0df+94bMpVRGXkxB00I7zk0Xbhi+qvKqT0wLL6xhta+FFRgQ0KG9Q HRV19Bo3Sm1cr+Bgd3S1MjUBI3XMwv1yLXv+I66lp/UxTjqLQfL3wPssNiVPMT6nptld jkCMufnc+/sdWOjKuH0MUcncpXixNY1jm7/1bYrxBpUGCSNvg8NUA5Sl7d1WmIxeYAfS IZPbGSyccIGtaozyFT/WR6MOmkeeJhP+ILa+rdxc30+5yv82bxKEaeIgiH6yewG6RY7e tIlxjZWKONLcrV01Ko9WidBc1TrgmGz/s1AXsW2/ddRVhfP5Ox7gLVSgTFWAyH+zNnsK CZRw== X-Gm-Message-State: AOAM531OkYDcOYD7impR41pTEC1/f650vgxvTrjzzgsDB6+68voDEnjT SG2EeO5HprJRUYLyzzJ+8mA= X-Google-Smtp-Source: ABdhPJwczvb1v+MrCxZPNS7XyueuQl5MT8xL1pUdSc01BKZ7V1WJmq74mQcvJJxfyGtAJSpzsXSxAQ== X-Received: by 2002:a05:6808:118c:b0:2d4:4194:70db with SMTP id j12-20020a056808118c00b002d4419470dbmr695742oil.93.1653561989004; Thu, 26 May 2022 03:46:29 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id v16-20020a4ae6d0000000b0035eb4e5a6cfsm472515oot.37.2022.05.26.03.46.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 03:46:28 -0700 (PDT) Message-ID: Subject: Re: [PATCH v3] ld: add --package-metadata From: Luca Boccassi To: Alan Modra Cc: binutils@sourceware.org, nickc@redhat.com Date: Thu, 26 May 2022 11:46:25 +0100 In-Reply-To: References: <20220515191846.114257-1-luca.boccassi@gmail.com> <20220525134147.2470281-1-luca.boccassi@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-fM8kO7+G0z70u4cS2CZB" User-Agent: Evolution 3.38.3-1+plugin MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, BODY_8BITS, 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: Thu, 26 May 2022 10:46:32 -0000 --=-fM8kO7+G0z70u4cS2CZB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2022-05-26 at 13:25 +0930, Alan Modra wrote: > On Wed, May 25, 2022 at 02:41:47PM +0100, luca.boccassi@gmail.com wrote: > > From: Luca Boccassi > >=20 > > Generate a .note.package FDO package metadata ELF note, following > > the spec: https://systemd.io/ELF_PACKAGE_METADATA/ > >=20 > > If the jansson library is available at build time (and it is explicitly > > enabled), link ld to it, and use it to validate that the input is > > correct JSON, to avoid writing garbage to the file. The > > configure option --enable-jansson has to be used to explicitly enable > > it (error out when not found). This allows bootstrappers (or others who > > are not interested) to seamlessly skip it without issues. > > --- > > v2: fix style issues > > =C2=A0=C2=A0=C2=A0=C2=A0fix ASAN issue: note storage is rounded up, but= that size > > =C2=A0=C2=A0=C2=A0=C2=A0was used to read the json input, which is fixed > > =C2=A0=C2=A0=C2=A0=C2=A0add entry to NEWS > > =C2=A0=C2=A0=C2=A0=C2=A0add note about json validation to docs > > v3: switch libjansson support to disabled-by-default even if > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0the library is available in the bui= ld environment > > =C2=A0=C2=A0=C2=A0=C2=A0update new test to account for old/new readelf,= which > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0might or might not pretty-print the= FDO note > > =C2=A0=C2=A0=C2=A0=C2=A0update bootstrap test to link with jansson if t= he object > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0files being linked were built with = it > > =C2=A0=C2=A0=C2=A0=C2=A0remove dead code >=20 > I'm about to commit this with a few formatting fixes, and with a > working bootstrap.exp change. That one was obviously not tested. The > idea was good but ld config.h is not in $srcdir/.., and besides that > it's on the build machine not the host (*), and plain grep is more > likely to exist than fgrep. >=20 > *) build vs host doesn't matter much in bootstrap.exp since those > tests are only run when native, but I'd like to get it correct for > someone doing copy/paste for a future config.h test. Thanks for fixing it! I did test it, and it was working on my machine, both with and without the new build flag: Running /home/bluca/git/binutils-gdb/ld/testsuite/ld-bootstrap/bootstrap.ex= p ... Running /home/bluca/git/binutils-gdb/ld/testsuite/ld-bpf/bpf.exp ... I imagine this is because I was running 'make check' from the ld/ directory? I took '$srcdir' and 'fgrep' from existing scripts in other tests in ld/testsuite. Anyway, the important thing is that it's all good now. Thanks again! --=20 Kind regards, Luca Boccassi --=-fM8kO7+G0z70u4cS2CZB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCSqx93EIPGOymuRKGv37813JB4FAmKPWoEACgkQKGv37813 JB6x4A/9FY97UEbqBEJ4dB+k0CD+dVAzbZDQghHAbPcevEEdWsEajgDvXqFLhctU y8LRXk1vYLwxb9fFtLzKp6/BMvDHZxJTXQmGt3pgpVu+dKNPkSn1owBfk/rH5Hb/ uSOqTa4IvpckvLkFsOUFNPbFICyO6xpVVtm+UedrhK2VasrphPO5rrGZboF3FGxM cJ8TqFXVB1pOdsMef14fblNeFjoJnrlQuMoGXQSl7v3LICISbVMbXfov3EQPZI6r FfTnjKmWdK1iTNUDfA8UcbCGi0TZxAdUwsUAvjbZtjcVpJDRtjz6KUcdTwwZeYhI cEgh2xAr920EtoKkxRRHZw1+P9lcCXIxq5X1JoBNHQ7XCz+UAX1N8pfoW6DyL/1T 31jzGLbnOrRQ120aLg2DUYuWyyMJxBTWjkSz2Jlq/OEQSdr/3VlySq9gD9qUOTeM lfEzGLXmxIVL975INpkRQRHjy1X2Ldrsu9F+alw+RNWWFMGuHHhVTOqwuKw9SB9q q8yVjEYy6s+v2FSrOfVTBCW0Gnqa5r850aA28ClLUzAgH6lBMLlunWM/EckraZWN CYKPMkzeGTu26BEgLh/Ji/5sRjyMbVM+D6Mmx1l/8o0s1L4RGL0ovaNNbPHO1np8 m+rtSQPU2TR8+XaSt+hGoMJ8oUVCQ+KNsVL1Vsb1XL4OXP+Ev2o= =aeO3 -----END PGP SIGNATURE----- --=-fM8kO7+G0z70u4cS2CZB--