#include <linux/module.h>
#include <linux/module_symbol.h>
#include <linux/kallsyms.h>
#include <linux/buildid.h>
#include <linux/bsearch.h>
#include "internal.h"
static const struct kernel_symbol *lookup_exported_symbol(const char *name,
const struct kernel_symbol *start,
const struct kernel_symbol *stop)
{ … }
static int is_exported(const char *name, unsigned long value,
const struct module *mod)
{ … }
static char elf_type(const Elf_Sym *sym, const struct load_info *info)
{ … }
static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs,
unsigned int shnum, unsigned int pcpundx)
{ … }
void layout_symtab(struct module *mod, struct load_info *info)
{ … }
void add_kallsyms(struct module *mod, const struct load_info *info)
{ … }
#if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID)
void init_build_id(struct module *mod, const struct load_info *info)
{ … }
#else
void init_build_id(struct module *mod, const struct load_info *info)
{
}
#endif
static const char *kallsyms_symbol_name(struct mod_kallsyms *kallsyms, unsigned int symnum)
{ … }
static const char *find_kallsyms_symbol(struct module *mod,
unsigned long addr,
unsigned long *size,
unsigned long *offset)
{ … }
void * __weak dereference_module_function_descriptor(struct module *mod,
void *ptr)
{ … }
int module_address_lookup(unsigned long addr,
unsigned long *size,
unsigned long *offset,
char **modname,
const unsigned char **modbuildid,
char *namebuf)
{ … }
int lookup_module_symbol_name(unsigned long addr, char *symname)
{ … }
int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
char *name, char *module_name, int *exported)
{ … }
static unsigned long __find_kallsyms_symbol_value(struct module *mod, const char *name)
{ … }
static unsigned long __module_kallsyms_lookup_name(const char *name)
{ … }
unsigned long module_kallsyms_lookup_name(const char *name)
{ … }
unsigned long find_kallsyms_symbol_value(struct module *mod, const char *name)
{ … }
int module_kallsyms_on_each_symbol(const char *modname,
int (*fn)(void *, const char *, unsigned long),
void *data)
{ … }