Currently we never dump the sh_offset key.
Though it sometimes an important information.
To reduce the noise this patch implements the following logic:
- The "Offset" key for the first section is always emitted.
- If we can derive the offset for a next section naturally, then the "Offset" key is omitted.
By "naturally" I mean that section[X] offset is expected to be:
offsetOf(section[X]) == alignTo(section[X - 1].sh_offset + section[X - 1].sh_size, section[X].sh_addralign)
So, when it has the expected value, we omit it from the output.
Just trying to understand why this and the .data Offsets are needed explicitly here, when they weren't prior to this patch?