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

Support Extended Modversions #270

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maurer
Copy link

@maurer maurer commented Dec 20, 2024

A companion to the EXTENDED_MODVERSIONS kernel patch series, this PR adds support for libkmod to access the new modversions format when present, falling back to the original format otherwise.

Tested with KDIR= override selecting a kernel with EXTENDED_MODVERSIONS=y and BASIC_MODVERSIONS=n enabled with the series above in addition to a normal existing kernel.

In order to allow longer names, the kernel is taking a new MODVERSIONS
format option which stores the names in a strtab-like section and the
crcs in an array-like one. This patch:

1. Makes `kmod_elf_get_modversions` use either format, preferring the new
   one where present.
2. Makes `kmod_elf_get_dependency_symbols` dispatch to
   `kmod_elf_get_modversions` rather than open-coding the same version
   extraction, to avoid duplicating either the old or new logic.

Signed-off-by: Matthew Maurer <[email protected]>
We can't test actual CRC values, because they may vary depending on
kernel configuration. We can ensure the correct symbol names show up
though.

Signed-off-by: Matthew Maurer <[email protected]>
@stoeckmann
Copy link
Contributor

Noticed these issues while reviewing changes: #272

Since they are already in master, I have created a new PR. No need to slow down functional review if there are bugs in the underlying base. ;)

These PRs should be kept in sync, depending which one is merged first.

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.

2 participants