pyelftools icon indicating copy to clipboard operation
pyelftools copied to clipboard

clang `const void*` producing: WARNING: broken DIE: DIE DW_TAG_const_type, size=1, has_children=False

Open nickdesaulniers opened this issue 3 years ago • 7 comments

I think this is coming from pyelftools. Just filing a bug for now in case others come across this, too.

nickdesaulniers avatar Oct 04 '22 23:10 nickdesaulniers

👋 Nick. This is an odd issue report - any reproducer?

eliben avatar Oct 04 '22 23:10 eliben

32b x86 linux kernel build.

Indeed via llvm-dwarfdump I see:

0x00005202:     NULL

0x00005203:   DW_TAG_pointer_type
                DW_AT_type      (0x00005208 "const void")

0x00005208:   DW_TAG_const_type

0x00005209:   DW_TAG_pointer_type
                DW_AT_type      (0x0000520e "kioctx_table")

so perhaps a bug in clang producing empty type tags.

nickdesaulniers avatar Oct 05 '22 00:10 nickdesaulniers

oh, 0x00005203 is a pointer type, it points to a const void. void has an empty DW_TAG_const_type.

const void is pretty funny. "I don't know what this type is, but you'd better not modify it!"

nickdesaulniers avatar Oct 05 '22 00:10 nickdesaulniers

Saw that too. void* is reported as a pointer to nothing. pyelftools itself parses that happily. Where exactly is the warning?

sevaa avatar Oct 05 '22 01:10 sevaa