]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: store common section off/size and use them
authorEmil Velikov <emil.l.velikov@gmail.com>
Wed, 23 Oct 2024 23:27:08 +0000 (00:27 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 15 Nov 2024 16:03:46 +0000 (10:03 -0600)
commit16ea23b741fbf3330827d6c41701d80a278c1d1c
tree3c6dba2bf55561f25484c4a5bcb8254f648471e6
parent9099346ce99f23689a26759bcc77d5dda9fd4557
libkmod: store common section off/size and use them

Currently, we repeatedly loop over the elf headers looking for five well
known sections. Just do it once in kmod_elf_new() and reuse the data as
needed.

Note that not all sections are guaranteed to be available, so check and
ELFDBG print the ones which are missing.

v2: quit looping when found, ELFDBG print missing sections
v3: match the first section name, use a loop

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/210
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-elf.c