Issue 180503.1: Usage suggestion for LEB128 padding

Author: Paul Robinson
Champion: Paul Robinson
Date submitted: 2018-05-03
Date revised: 2021-04-19
Date closed: 2021-05-17
Type: Improvement
Status: Accepted
DWARF Version: 6
Section 7.6, pg 222


Values in the LEB128 format are currently required to be minimum 
length; in some cases it may be advantageous to pad or align data 
by inserting leading zero or sign-extension bytes that don't affect 
the decoded value.

Discussion in a committee meeting revolved around whether to impose
limits on producers, or requirements on consumers.  The proposed 
change specifically does not imply that a producer could pad with 
*extra* bytes, but could simply not *remove* bytes from an ordinary
integer value; this avoids any suggestion that we could end up with
arbitrarily long LEB128 strings.


Section 7.6, pg 221, line 12, replace "be zero; discard them."
with "be zero, which may be discarded."

pg 222, line 13, add a new non-normative paragraph:

*Some producers may choose to insert padding or alignment bytes by 
retaining (not discarding) one or more high-order bytes that would 
not affect the decoded value.*

2021-04-19 Revised.  Previous version:
2021-05-17 Accepted.