This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Feature request: improved build-id generation
- From: Andy Lutomirski <luto at kernel dot org>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Mark Wielaard <mjw at fedoraproject dot org>, Cary Coutant <ccoutant at gmail dot com>, Andy Lutomirski <luto at kernel dot org>, Alan Modra <amodra at gmail dot com>, Binutils <binutils at sourceware dot org>, Laura Abbott <labbott at redhat dot com>, X86 ML <x86 at kernel dot org>, Linus Torvalds <torvalds at linux-foundation dot org>, "H. J. Lu" <hjl dot tools at gmail dot com>, Kernel Fedora <kernel at lists dot fedoraproject dot org>
- Date: Thu, 15 Mar 2018 17:07:53 +0000
- Subject: Re: Feature request: improved build-id generation
- Dmarc-filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9B8B21748
- References: <CALCETrUK35iiygNfA9mqDLx7SZDh-eXk885fvDTOXOR1jFFOAg@mail.gmail.com> <20180314232701.GD3812@bubble.grove.modra.org> <15D8DF02-CF44-41C9-980D-BEB97F42ACF0@amacapital.net> <20180315010105.GE3812@bubble.grove.modra.org> <CAJimCsESQoDZTij1cqQtpzrUvCGqLc_bt9it0OvkpoEyGc+t7A@mail.gmail.com> <CALCETrXnyxjhiVKtF4jGBtFsD1gdQkxT+5QnksdXhGn8DW2cRw@mail.gmail.com> <CAJimCsEu7OEVY0Cgu0uNwAOk5W6y0MTgknKaDAKTsXqBMFwFCw@mail.gmail.com> <6a027137-b407-bdaf-c03e-42fa7f62a94c@redhat.com> <1521115292.15770.6.camel@fedoraproject.org> <80092e21-bee8-d98f-46ec-db0311b71942@redhat.com>
On Thu, Mar 15, 2018 at 1:32 PM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Mark,
>
>> That might be an interesting alternative. Could you use this for e.g.
>> inserting a .comment section fragment with an unique (version) string?
>> That would be stripped away, but should still count for the build-id
>> hash calculation.
>
...
>
> % gcc hello.c -Wl,comment.t
> % readelf -p.comment a.out
>
> String dump of section '.comment':
> [ 0] GCC: (GNU) 7.3.1 20180130 (Red Hat 7.3.1-2)
> [ 2c] GCC: (GNU) 7.2.1 20170915 (Red Hat 7.2.1-2)
> [ 58] ABC
>
> A simple perl or python script could be used to create the comment.t
> linker script fragment.
When you say 'stripped away', do you mean that 'strip' would remove
it? Neither plain strip nor 'strip -S' seem to be doing the job.
Sticking additional information in the object that affects the
build-id, shows up in the separate debug data, and does *not* show up
in the actual running ELF file seems quite handy. Then there could be
a tool that would take an ELF file, find its debug info, and parse out
the Fedora package name and version :)
--Andy