[Bug 269928] ctfconvert errors should be fatal

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 03 Mar 2023 02:05:39 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269928

            Bug ID: 269928
           Summary: ctfconvert errors should be fatal
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: markj@FreeBSD.org

ctfconvert has long contained a FreeBSD-specific hack to downgrade various
errors into warnings.  CTFv3 has eliminated much of the need for this hack, so
it should be revisited since it causes problems when cross-building FreeBSD on
MacOS and Linux.

For instance, in a riscv kernel objdir:

markj@nuc> readelf -S exception.o | grep -A1 debug_info
  [ 7] .debug_info       PROGBITS         0000000000000000  00000288
       0000000000000185  0000000000000000           0     0     1
  [ 8] .rela.debug_info  RELA             0000000000000000  00000a80
       00000000000000d8  0000000000000018   I      14     7     8
markj@nuc> ctfconvert -L VERSION -g exception.o 
ERROR: ctfconvert: failed to get offset for die: Invalid argument
[dwarf_dieoffset(261)]
markj@nuc> readelf -wi exception.o

Dump of debug contents of section .debug_info:
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die
readelf: could not find DW_TAG_compile_unit die

but binutils readelf can handle it fine, so this is some bug or missing
functionality in libdwarf.  Such a problem should cause a build failure.

-- 
You are receiving this mail because:
You are the assignee for the bug.