This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]