[PATCH] D18055: ELF: Implement --build-id.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 11:52:23 PST 2016


On Fri, Mar 11, 2016 at 11:49 AM, Ed Maste <emaste at freebsd.org> wrote:

> On 11 March 2016 at 13:32, Rui Ueyama <ruiu at google.com> wrote:
> > I sent out http://reviews.llvm.org/D18091 for review. It implements FNV1
> > hash.
>
> Great! I've applied it locally and am testing it out.
>
> >> One other item to consider, some tools make expectations about the
> >> size of the build-id data. For example, "file" uses the size to report
> >> the putative algorithm used. It reports "sha1" for a 20-byte build-id
> >> and "md5/uuid" for a 16-byte build-id.
> >> [...]
> >>
> > The build-id note section has the size field for the build-id so that any
> > tools that reads an ID is able to know the size of it. In our case,
> because
> > it is 64-bit FNV1, it's set to 8 (byte.)
>
> Right, I just mean that some tools aren't prepared to handle a
> build-id note that is not either 16 or 20 bytes. For example, with an
> 8-byte build ID file doesn't report anything. This is arguably a file
> bug, but I wouldn't be surprised if some other tools behave the same
> way.
>

It doesn't seem to make sense to leave 8 byte blank in the .note section.
I'd think that setting the size to 8 byte conveys the message that there is
a chance of collision, too. So I guess that keeping it 8 bytes is a good
idea.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160311/6c3c1646/attachment.html>


More information about the llvm-commits mailing list