From: Lucas De Marchi Date: Thu, 26 Jan 2012 03:21:17 +0000 (-0200) Subject: elf: privately export kmod_elf_get_section() X-Git-Tag: v5~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea17e2b0433f78f2972004b0850fa8a440fe5333;p=thirdparty%2Fkmod.git elf: privately export kmod_elf_get_section() This function is used to find a certain section in ELF file. It will be used to get the modname from an ELF file. --- diff --git a/libkmod/libkmod-elf.c b/libkmod/libkmod-elf.c index 72e3c5f7..1f47e075 100644 --- a/libkmod/libkmod-elf.c +++ b/libkmod/libkmod-elf.c @@ -375,7 +375,7 @@ const void *kmod_elf_get_memory(const struct kmod_elf *elf) return elf->memory; } -static int kmod_elf_get_section(const struct kmod_elf *elf, const char *section, const void **buf, uint64_t *buf_size) +int kmod_elf_get_section(const struct kmod_elf *elf, const char *section, const void **buf, uint64_t *buf_size) { uint64_t nameslen; const char *names = elf_get_strings_section(elf, &nameslen); diff --git a/libkmod/libkmod-private.h b/libkmod/libkmod-private.h index 55c7206b..274cb1d0 100644 --- a/libkmod/libkmod-private.h +++ b/libkmod/libkmod-private.h @@ -164,6 +164,12 @@ int kmod_elf_get_dependency_symbols(const struct kmod_elf *elf, struct kmod_modv int kmod_elf_strip_section(struct kmod_elf *elf, const char *section) __must_check __attribute__((nonnull(1,2))); int kmod_elf_strip_vermagic(struct kmod_elf *elf) __must_check __attribute__((nonnull(1))); +/* + * Debug mock lib need to find section ".gnu.linkonce.this_module" in order to + * get modname + */ +int kmod_elf_get_section(const struct kmod_elf *elf, const char *section, const void **buf, uint64_t *buf_size) __must_check __attribute__((nonnull(1,2,3,4))); + /* util functions */ #include "libkmod-util.h"