lookup: rename 'value' -> 'addr'

Rename 'value' to 'addr' to more accurately describe it.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
This commit is contained in:
Josh Poimboeuf 2018-04-18 13:39:56 -05:00
parent 5fad6599a4
commit cd121422d9
3 changed files with 11 additions and 11 deletions

View File

@ -2755,7 +2755,7 @@ static void kpatch_create_patches_sections(struct kpatch_elf *kelf,
} }
log_debug("lookup for %s @ 0x%016lx len %lu\n", log_debug("lookup for %s @ 0x%016lx len %lu\n",
sym->name, result.value, result.size); sym->name, result.addr, result.size);
/* /*
* Convert global symbols to local so other objects in the * Convert global symbols to local so other objects in the
@ -2768,7 +2768,7 @@ static void kpatch_create_patches_sections(struct kpatch_elf *kelf,
GELF_ST_INFO(sym->bind, sym->type); GELF_ST_INFO(sym->bind, sym->type);
/* add entry in text section */ /* add entry in text section */
funcs[index].old_addr = result.value; funcs[index].old_addr = result.addr;
funcs[index].old_size = result.size; funcs[index].old_size = result.size;
funcs[index].new_size = sym->sym.st_size; funcs[index].new_size = sym->sym.st_size;
funcs[index].sympos = result.pos; funcs[index].sympos = result.pos;
@ -3096,11 +3096,11 @@ static void kpatch_create_intermediate_sections(struct kpatch_elf *kelf,
} }
} }
log_debug("lookup for %s @ 0x%016lx len %lu\n", log_debug("lookup for %s @ 0x%016lx len %lu\n",
rela->sym->name, result.value, result.size); rela->sym->name, result.addr, result.size);
/* Fill in ksyms[index] */ /* Fill in ksyms[index] */
if (vmlinux) if (vmlinux)
ksyms[index].src = result.value; ksyms[index].src = result.addr;
else else
/* for modules, src is discovered at runtime */ /* for modules, src is discovered at runtime */
ksyms[index].src = 0; ksyms[index].src = 0;

View File

@ -41,7 +41,7 @@
#include "log.h" #include "log.h"
struct object_symbol { struct object_symbol {
unsigned long value; unsigned long addr;
unsigned long size; unsigned long size;
char *name; char *name;
int type, bind; int type, bind;
@ -201,7 +201,7 @@ static char *make_modname(char *modname)
static void symtab_read(struct lookup_table *table, char *path) static void symtab_read(struct lookup_table *table, char *path)
{ {
FILE *file; FILE *file;
long unsigned int value; long unsigned int addr;
int alloc_nr = 0, i = 0; int alloc_nr = 0, i = 0;
int matched; int matched;
bool skip = false; bool skip = false;
@ -243,7 +243,7 @@ static void symtab_read(struct lookup_table *table, char *path)
continue; continue;
matched = sscanf(line, "%*s %lx %s %s %s %*s %s %s\n", matched = sscanf(line, "%*s %lx %s %s %s %*s %s %s\n",
&value, size, type, bind, ndx, name); &addr, size, type, bind, ndx, name);
if (matched == 5) { if (matched == 5) {
name[0] = '\0'; name[0] = '\0';
@ -255,7 +255,7 @@ static void symtab_read(struct lookup_table *table, char *path)
!strcmp(type, "SECTION")) !strcmp(type, "SECTION"))
continue; continue;
table->obj_syms[i].value = value; table->obj_syms[i].addr = addr;
table->obj_syms[i].size = strtoul(size, NULL, 0); table->obj_syms[i].size = strtoul(size, NULL, 0);
if (!strcmp(bind, "LOCAL")) { if (!strcmp(bind, "LOCAL")) {
@ -430,7 +430,7 @@ int lookup_local_symbol(struct lookup_table *table, char *name,
return 1; return 1;
result->pos = pos; result->pos = pos;
result->value = sym->value; result->addr = sym->addr;
result->size = sym->size; result->size = sym->size;
return 0; return 0;
} }
@ -445,7 +445,7 @@ int lookup_global_symbol(struct lookup_table *table, char *name,
for_each_obj_symbol(i, sym, table) { for_each_obj_symbol(i, sym, table) {
if ((sym->bind == STB_GLOBAL || sym->bind == STB_WEAK) && if ((sym->bind == STB_GLOBAL || sym->bind == STB_WEAK) &&
!strcmp(sym->name, name)) { !strcmp(sym->name, name)) {
result->value = sym->value; result->addr = sym->addr;
result->size = sym->size; result->size = sym->size;
result->pos = 0; /* always 0 for global symbols */ result->pos = 0; /* always 0 for global symbols */
return 0; return 0;

View File

@ -4,7 +4,7 @@
struct lookup_table; struct lookup_table;
struct lookup_result { struct lookup_result {
unsigned long value; unsigned long addr;
unsigned long size; unsigned long size;
unsigned long pos; unsigned long pos;
}; };