Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate ELF symbols of unknown type in symbolization #1006

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented Feb 13, 2025

The symbolize_kernel_system_vmlinux test flagged another case of symbols that we may want to handle better: some ELF symbols have type NOTYPE, which according to the specification means "The symbol's type is not defined". So far we have outright excluded these symbols from symbolization, but it seems better to include them, as they could refer to either variables or functions (or, potentially anything else there is...). Presumably they refer to unannotated definitions made directly in assembly. An example is:

 63755: ffffffff81601120   117 NOTYPE  GLOBAL DEFAULT    1 entry_SYSENTER_compat

With this change we make sure to include these symbols when parsing symbol tables and report them when asking for both functions and variables.

The symbolize_kernel_system_vmlinux test flagged another case of symbols
that we may want to handle better: some ELF symbols have type NOTYPE,
which according to the specification means "The symbol's type is not
defined". So far we have outright excluded these symbols from
symbolization, but it seems better to include them, as they could refer
to either variables or functions (or, potentially anything else there
is...). Presumably they refer to unannotated definitions made directly
in assembly. An example is:
```
 63755: ffffffff81601120   117 NOTYPE  GLOBAL DEFAULT    1 entry_SYSENTER_compat
```

With this change we make sure to include these symbols when parsing
symbol tables and report them when asking for both functions and
variables.

Signed-off-by: Daniel Müller <[email protected]>
@d-e-s-o d-e-s-o force-pushed the topic/elf-notype branch 3 times, most recently from a9eff64 to ab38e59 Compare February 13, 2025 22:13
@d-e-s-o d-e-s-o marked this pull request as draft February 13, 2025 23:19
@d-e-s-o d-e-s-o force-pushed the topic/elf-notype branch 2 times, most recently from 651354c to 1a547a1 Compare February 20, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant