Re: F36 Change: Package information on ELF objects (System-Wide Change proposal)

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

 



Hi,

On Mon, 2021-10-25 at 15:09 -0400, Ben Cotton wrote:
> https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects

I like this idea. It will be really useful when multiple distros adopt
it.

> === New system: `.note.package` ===
> 
> The new note is created and propagated similarly to
> `.note.gnu.build-id`. The difference is that we inject the
> information
> about package ''nevra'' from the build system.
> 
> The implementation is very simple: `%{build_ldflags}` are extended
> with a command to insert a custom note as a separate section in an
> ELF
> object. See [
> https://github.com/systemd/package-notes/blob/main/hello.spec
> hello.spec] for an example. This is done in the default macros, so
> all
> packages that use the prescribed link flags will be affected.
> 
> The note is a compact json string. This allows the format to be
> trivially extensible (new fields can be added at will), easy to
> process (json is extremely popular and parsers are widely available).
> Using a single field rather than a set of separated notes is more
> space-efficient. With multiple fields the padding and alignment
> requirements cause unnecessary overhead.
> 
> The system was designed with cross-distro collaboration and is
> flexible enough to identify binaries from different packaging formats
> and build systems (rpms, debs, custom binaries).
> 
> See https://systemd.io/COREDUMP_PACKAGE_METADATA/ for detailed
> description of the format.

It isn't immediately clear to me which of the key's will be included.
The format describes 6 standard ones: type, os, osVersion, name,
version, osCpe and debugInfoUrl. But the example given later only shows
type, name, version and osCpe.

To me the debugInfoUrl is the most interesting because combined with
the already existing build-id note it allows automagic fetching of the
debuginfo and sources (and the debuginfod server could tell you the
type, name and version of the archive, so in theory you don't have to
include those fields, but they might still be useful if you cannot
access the debuginfod url).

One ELF technicality I don't see described is the alignment and padding
of the ELF NOTE. Normally on GNU systems ELF NOTEs are aligned on 4
bytes (for both 32/64 bit ELF files). But the recent .note.gnu.property
NOTEs are aligned on 4 bytes for 32bit systems, but 8 bytes on 64bit
systems (this is causing some interesting issues trying to combine
those NOTEs...). What alignment/padding will this new ELF note have?

Thanks,

Mark
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux