[patch rfc]: use xxhash() in ld build-id computation, incl. benchmark
Frank Ch. Eigler
fche@redhat.com
Fri Sep 20 15:46:56 GMT 2024
Hi -
> A few small tweaks please:
No problem:
> * Please could you add a line to the ld/NEWS file mentioning the
> support for the hash method (if enabled when the linker was
> built). Maybe even mention how much faster it is. :-)
> * Similarly please could you update the description of the --build-id
> option in the ld/ld.texi file.
OK, how about this (diffs ugly, showing patched version:)
(ld/NEWS):
Changes in 2.44:
* Add a "--build-id=xx" option, if built with the xxhash library. This
produces a 128-bit hash, 2-4x faster than md5 or sha1.
(ld.texi, adding xx but weakening the "will be unique among all
nonidentical output files" language, which even md5/sha1 could not
really guarantee):
Request the creation of a @code{.note.gnu.build-id} ELF note section
or a @code{.buildid} COFF section. The contents of the note are
unique bits identifying this linked file. @var{style} can be
@code{uuid} to use 128 random bits; @code{sha1} to use a 160-bit
@sc{SHA1} hash, @code{md5} to use a 128-bit @sc{MD5} hash, or @code{xx}
to use a 128-bit @sc{XXHASH} on the normative parts of the output
contents; or @code{0x@var{hexstring}} to use a chosen bit string
specified as an even number of hexadecimal digits (@code{-} and
@code{:} characters between digit pairs are ignored). If @var{style}
is omitted, @code{sha1} is used.
The @code{md5}, @code{sha1}, and @code{xx} styles produces an
identifier that is always the same in an identical output file, but
are almost certainly unique among all nonidentical output files. It
is not intended to be compared as a checksum for the file's contents.
A linked file may be changed later by other tools, but the build ID
bit string identifying the original linked file does not change.
> * Mega minor code formatting nit:
> [...]
(Done.)
- FChE
More information about the Binutils
mailing list