This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
dwarflint vs 10-byte leb128
- From: Roland McGrath <roland at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Sat, 17 Jan 2009 19:36:50 -0800
- Subject: dwarflint vs 10-byte leb128
Your check for bogus LEB128 rejects a correct encoding of 64 bits. 9 bytes
encodes 63 bits, and 64 bits takes 10 bytes. A 10-byte encoding is correct
as long as the last byte is 0x1, since encoding more than 64 bits is bogus.
This comes up because of some bogons, but they are higher-level bogons.
It's hitting in location expressions like DW_OP_plus_uconst(0xfffffffffffffff8).
That's a bogon because the compiler meant -8 but used plus_uconst, which
only takes an unsigned constant. I think it would be reasonable to cite
any unsigned constant with lots of high 1 bits as "suspicious".
Thanks,
Roland