]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ld: support --build-id=xx mode
authorFrank Ch. Eigler <fche@redhat.com>
Thu, 19 Sep 2024 21:06:48 +0000 (17:06 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Fri, 20 Sep 2024 20:14:03 +0000 (16:14 -0400)
commitd979aad8c8d44d40794cc4cf0baae6f7200f78aa
tree8c30da22b8557a1c8869790106080f8fbdee7a40
parent5b84cbc35ad574483781e62b7fddbcbf73cf2ad3
ld: support --build-id=xx mode

The is patch adds a new ld build-id computation mode, "xx", using
xxhash in its 128-bit mode.  The patch prereqs the xxhash-devel
headers being installed, and uses the "all-inlined" model, so no
run-time or link-time library dependence exists.

The xxhash mode performs well, saving roughly 20% of total userspace
run time from an ld job over a 800MB shared library relative to sha1.
128 bits of good hash should be collision-resistant to a number of
distinct binaries that numbers in the 2**32 - 2**64 range, even if not
"crypto" level hash.  Confirmations of this are in progress.

         ld/configury: add --with-xxhash mode, different from gdb case
                       because only using it in inline mode

         ld/ldbuildid.c: add "xx" mode, #if WITH_XXHASH

         ld/NEWS, ld.texi: mention new option

         ld/lexsup.c: add enumeration of --build-id STYLES to --help

         ld/testsuite/ld-elf/build-id.exp: add test case for 0xHEX case
                                           and conditional for xx case;
                                           also, simply tcl list syntax

https://inbox.sourceware.org/binutils/20240917201509.GB26396@redhat.com/

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
ld/NEWS
ld/config.in
ld/configure
ld/configure.ac
ld/ld.texi
ld/ldbuildid.c
ld/lexsup.c
ld/testsuite/ld-elf/build-id.exp
ld/testsuite/ld-elf/pr28639e.rd [new file with mode: 0644]