Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Apr 2026 22:37:06 +0200
From:      Paul Floyd <paulf2718@gmail.com>
To:        Ed Maste <emaste@freebsd.org>, Gleb Popov <arrowd@freebsd.org>
Cc:        Dimitry Andric <dim@freebsd.org>, "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: debug files now have program headers
Message-ID:  <5de1cac2-8480-4d39-a2a6-dc882a65ba79@gmail.com>
In-Reply-To: <CAPyFy2A7wC4SrmY4OinFTin3tzFYJFeh1ajdD2H4P9PDCfM1Xw@mail.gmail.com>
References:  <707b0fa7-b345-4802-a018-d6050f4e8f8c@gmail.com> <4DDACD68-1AF2-4502-AF20-4EAB15B13659@FreeBSD.org> <CALH631nbdGh-31LvLEsn5C9iRdupWkxCQRmxrEuOJ-_USgbxSw@mail.gmail.com> <CAPyFy2A7wC4SrmY4OinFTin3tzFYJFeh1ajdD2H4P9PDCfM1Xw@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]

On 2026-04-07 18:12, Ed Maste wrote:
> Yes, it should be LLVM_BINUTILS_BOOTSTRAP that's responsible, not
> LLVM_BINUTILS. The former is only in main while LLVM_BINUTILS is also
> in stable/15. The changes to support LLVM_BINUTILS BOOTSTRAP were
> missing from the original LLVM_BINUTILS work; it was not intentional
> that we continued to use ELF Tool Chain tools for the bootstrap.
>
> We discovered this because another tool (i.e., libabigail) failed when
> the standalone debug files _lacked_ program headers, and I believe
> this is the expected state in the GNU tool / Linux distro world. I
> presume Valgrind on Linux handles this somehow?

Hi Ed

I suspect that this is the first time that that this has been observed. 
That means that Valgrind on Linux probably has the same problem.

This issue will need fixing.

Very briefly, the issue is caused in the code that runs only with -v -v 
or more that will print something like

==61545== Adding active redirection:
--61545--     new: 0x7ff80cb94c65 (operator new(unsigne) R-> (1003.0) 
0x100181f50 operator new(unsigned long, std::align_val_t)

at that point in the code it only has the function addresses, so it 
calls some functions to look up the names. That is quite involved. On 
the way it will call is_elf_object_file_by_DiImage [Di = Debuginfo]. 
That just looks at the ELF header. Previously it returned false as there 
was no program header in the split debug files. Now it is returning true.

I think that the fix will be to add a further check for a non-zero sized 
PT_DYNAMIC segment. is_elf_object_file_by_DiImage is used in several 
places so I have to make sure that there are no bad side effects.

Regards

Paul


[-- Attachment #2 --]
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2026-04-07 18:12, Ed Maste wrote:<span
      style="white-space: pre-wrap">
</span></div>
    <blockquote type="cite"
cite="mid:CAPyFy2A7wC4SrmY4OinFTin3tzFYJFeh1ajdD2H4P9PDCfM1Xw@mail.gmail.com">
      <pre wrap="" class="moz-quote-pre">Yes, it should be LLVM_BINUTILS_BOOTSTRAP that's responsible, not
LLVM_BINUTILS. The former is only in main while LLVM_BINUTILS is also
in stable/15. The changes to support LLVM_BINUTILS BOOTSTRAP were
missing from the original LLVM_BINUTILS work; it was not intentional
that we continued to use ELF Tool Chain tools for the bootstrap.

We discovered this because another tool (i.e., libabigail) failed when
the standalone debug files _lacked_ program headers, and I believe
this is the expected state in the GNU tool / Linux distro world. I
presume Valgrind on Linux handles this somehow?
</pre>
    </blockquote>
    <p>Hi Ed</p>
    <p>I suspect that this is the first time that that this has been
      observed. That means that Valgrind on Linux probably has the same
      problem.</p>
    <p>This issue will need fixing. <br>
      <br>
      Very briefly, the issue is caused in the code that runs only with
      -v -v or more that will print something like<br>
      <br>
      <span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">==61545==
          Adding active redirection:</span><span
          style="color:#000000;background-color:#ffffff;">
        </span><br>
        <span style="color:#000000;background-color:#ffffff;">--61545--
              new: 0x7ff80cb94c65 (operator new(unsigne) R-&gt; (1003.0)
          0x100181f50 operator new(unsigned lo</span><span
          style="color:#000000;background-color:#ffffff;">ng,
          std::align_val_t)<br>
          <br>
        </span></span>at that point in the code it only has the function
      addresses, so it calls some functions to look up the names. That
      is quite involved. On the way it will call <span
        _ngcontent-ng-c667700145="" class="user-query-container"><span
          _ngcontent-ng-c3304835911=""
class="user-query-bubble-with-background enable-2026q1-formatting-improvements ng-star-inserted"><span
            _ngcontent-ng-c3304835911="" class="horizontal-container">is_elf_object_file_by_DiImage
            [Di = Debuginfo]. That just looks at the ELF header.
            Previously it returned false as there was no program header
            in the split debug files. Now it is returning true.</span></span></span></p>
    <p><span _ngcontent-ng-c667700145="" class="user-query-container"><span
          _ngcontent-ng-c3304835911=""
class="user-query-bubble-with-background enable-2026q1-formatting-improvements ng-star-inserted"><span
            _ngcontent-ng-c3304835911="" class="horizontal-container">I
            think that the fix will be to add a further check for a
            non-zero sized PT_DYNAMIC segment.
            is_elf_object_file_by_DiImage is used in several places so I
            have to make sure that there are no bad side effects.</span></span></span></p>
    <p>Regards</p>
    <p><span _ngcontent-ng-c667700145="" class="user-query-container"><span
          _ngcontent-ng-c3304835911=""
class="user-query-bubble-with-background enable-2026q1-formatting-improvements ng-star-inserted"><span
            _ngcontent-ng-c3304835911="" class="horizontal-container">Paul</span></span></span></p>
    <p><span _ngcontent-ng-c667700145="" class="user-query-container"><span
          _ngcontent-ng-c3304835911=""
class="user-query-bubble-with-background enable-2026q1-formatting-improvements ng-star-inserted"><span
            _ngcontent-ng-c3304835911="" class="horizontal-container"><br>
          </span></span></span></p>
  </body>
</html>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5de1cac2-8480-4d39-a2a6-dc882a65ba79>