Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btf: redefine coreField.bitfieldOffset
coreField.bitfieldOffset is currently defined to count from the start of the enclosing composite type. This is incovenient, since the shift relocations want to know the offset from the start of the load. Redefine coreField.bitfieldOffset to count from the start of the field and add coreField.adjustOffsetBits to handle adjusting offset and bitfieldOffset while respecting alignment. Also compute offsets for the local relocation. We don't use this information at the moment, but it's what we do for other types of relocations. Finally, move the compatibility behaviour for regular fields accessed as bitfield into coreField.sizeBits. Doing the fixup only when encountering a bitfield leads to inconsistent behaviour.
- Loading branch information
Showing
2 changed files
with
64 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters