kpatch/kpatch-build/lookup.h
Chris J Arges b64ab2b5e4 livepatch-patch-hook: add support for livepatch sympos
Support patching objects that have duplicated function names. This feature was
introduced upstream in Linux v4.5.

This patch appends the symbol position to the symbol structure when
lookup_local_symbol is called. This pos variable is then used when creating the
funcs and dynrelas sections. Finally, incorporate sympos into the livepatch
patch hook only if the kernel version is greater than v4.5. In other cases the
older format is used.

Fixes: #493

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
2016-02-16 10:31:44 -06:00

21 lines
592 B
C

#ifndef _LOOKUP_H_
#define _LOOKUP_H_
struct lookup_table;
struct lookup_result {
unsigned long value;
unsigned long size;
unsigned long pos;
};
struct lookup_table *lookup_open(char *path);
void lookup_close(struct lookup_table *table);
int lookup_local_symbol(struct lookup_table *table, char *name, char *hint,
struct lookup_result *result);
int lookup_global_symbol(struct lookup_table *table, char *name,
struct lookup_result *result);
int lookup_is_exported_symbol(struct lookup_table *table, char *name);
#endif /* _LOOKUP_H_ */