This patchset eliminates all known discrepancies between DWARF/BTF, as tested on typical and allyesconfig Linux kernels. Patch #1 disables enum recoding, which can lose important enum size info. Patch #2 enforces fix up of negative bitfield_offsets early on in btf_loader. Patch #3 brings dwarf bitfield fixup logic closer to latest btf_encoder logic. Patch #4 completely rewrites bit/byte hole detection logic, fixing a lot of corners cases. Patch #5 simplifies __class__fprintf logic by relying on data calculated during hole detection phase. This and correct hole detection logic eliminates all the BRAIN FART ALERTs, emitted for allyesconfig. I did a lot of manual testing, comparison of new/old outputs for both BTF/DWARF loaders. I'm pretty convinced that these changes are correct and improves on previous state of pahole. But I'd still really appreciate independent verification from the side. Andrii Nakryiko (5): dwarf_loader: don't recode enums and use real enum size in calculations btf_loader: adjust negative bitfield offsets early on dwarf_loader: fix bitfield fixup logic for DWARF dwarves: revamp bit/byte holes detection logic dwarves: use bit sizes and bit/byte hole info in __class__fprintf btf_loader.c | 6 +++ dwarf_loader.c | 58 ++++++++++++--------- dwarves.c | 129 ++++++++++++++++++++++------------------------ dwarves_fprintf.c | 94 ++++++++++++--------------------- 4 files changed, 135 insertions(+), 152 deletions(-) -- 2.17.1