-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btf,info: Fix bad instruction offset when parsing infos from kernel
When BTF ext info is encoded in ELF the instruction offsets are in bytes, but when you pass them to the kernel they must be instruction indices. Therefore we divide the offset by the instruction size in the parsing logic for ELF. This was missed during the initial implementation of reading back BTF ext info from the kernel. This would cause an error when loading back ext info which was not a multiple of the instruction size or a bad instruction offset if it was. Fix this by making LoadLineInfos and LoadFuncInfos work on the kernel format which contains instruction offsets while the ELF parser uses bytes instead. Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com> Co-developed-by: Lorenz Bauer <lmb@isovalent.com>
- Loading branch information
1 parent
c42caeb
commit 50436f2
Showing
2 changed files
with
58 additions
and
30 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