Skip to content

v2023.04

tagged this 25 Apr 12:49
Binutils-2.40 introduced support for libzstd compressed bfd sections.
By default binutils configure will check for and use the system libzstd
library if it is present.

Now when compiling elf2flt using the bfd library from a
binutils-2.40 and a system present libzstd you will get link errors:

    /usr/bin/ld: ..//binutils-2.40/bfd/libbfd.a(compress.o): in function `decompress_contents':
    ../binutils-2.40/bfd/compress.c:517: undefined reference to `ZSTD_decompress'
    /usr/bin/ld: ../binutils-2.40/bfd/compress.c:519: undefined reference to `ZSTD_isError'
    /usr/bin/ld: ../binutils-2.40/bfd/libbfd.a(compress.o): in function `bfd_compress_section_contents':
    ../binutils-2.40/bfd/compress.c:656: undefined reference to `ZSTD_compress'
    /usr/bin/ld: ../binutils-2.40/bfd/compress.c:661: undefined reference to `ZSTD_isError'

Add a library check to the elf2flt configure for libzstd presence.
When present link using it.

There is no real problem when linking with -lzstd if compiling with
bfd libraries from older binutils, it just won't be needed. So there
is no need to make this check selective on binutils version.

Signed-off-by: Greg Ungerer <gerg@kernel.org>
Assets 2
Loading