Re: [PATCH v3] binutils, gdb: support zstd compressed debug sections

Tom Tromey
2022-09-27T18:09:20Z

>>>>> Fangrui Song via Gdb-patches <gdb-patches@sourceware.org> writes:

> PR29397 PR29563: The new configure option --with-zstd defaults to auto.
> If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support zstd
> compressed debug sections for most tools.

> * bfd: for addr2line, objdump --dwarf, gdb, etc
> * gas: support --compress-debug-sections=zstd
> * ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd
> * objcopy: support ELFCOMPRESS_ZSTD input for
> --decompress-debug-sections and --compress-debug-sections=zstd
> * gdb: support ELFCOMPRESS_ZSTD input. The bfd change references zstd
> symbols, so gdb has to link against -lzstd in this patch.

This also needs some change to the sims.
I see failures like this with git master:

make[4]: Entering directory '/home/tromey/gdb/build/sim/bpf'
CCLD run
../../bfd/libbfd.a(compress.o):compress.c:function decompress_contents: error: undefined reference to 'ZSTD_decompress'
../../bfd/libbfd.a(compress.o):compress.c:function decompress_contents: error: undefined reference to 'ZSTD_isError'
(unknown):176: error: undefined reference to 'ZSTD_compress'
(unknown):179: error: undefined reference to 'ZSTD_isError'
collect2: error: ld returned 1 exit status

You'll see them all if you do a build with all sims enabled.

thanks,
Tom