Re: debug files now have program headers

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Mon, 06 Apr 2026 14:15:27 UTC
On 6 Apr 2026, at 15:21, Paul Floyd <paulf2718@gmail.com> wrote:
> 
> I just noticed that debug files now contain program headers.
> 
> For instance, on 14.3-RELEASE
> 
> paulf> file /usr/lib/debug/lib/libc.so.7.debug
> /usr/lib/debug/lib/libc.so.7.debug: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), no program
> header, for FreeBSD 14.3, with debug_info, not stripped
> 
> but on 16.0-CURRENT
> 
> paulf> file /usr/lib/debug/lib/libc.so.7.debug
> /usr/lib/debug/lib/libc.so.7.debug: ELF 64-bit LSB shared object, ARM aarch64, version 1 (FreeBSD), dynamically linked, for FreeBSD 16.0 (1600014), with debug_info, not stripped
> 
> (I've seen this on amd64 and arm64).
> 
> That's causing problems with Valgrind if you use double verbose output (-v -v). With those options Valgrind will print details of functions that it redirects. Now that libc.so.debug looks like a real shared library rather than just a split debuginfo file Valgrind will try to read it for extra information. That extra information stomps on the correct information that it read from libc.so.7. The result is that functions like malloc no longer get redirected.
> 
> That's not a problem for most users but it is quite a big issue for me trying to debug Valgrind itself.
> 
> Is this going to be a permanent change?

I guess this is due to WITH_LLVM_BINUTILS being the default now.

-Dimitry