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",
sym->name, result.value, result.size);
sym->name, result.addr, result.size);
/*
* 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);
/* 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].new_size = sym->sym.st_size;
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",
rela->sym->name, result.value, result.size);
rela->sym->name, result.addr, result.size);
/* Fill in ksyms[index] */
if (vmlinux)
ksyms[index].src = result.value;
ksyms[index].src = result.addr;
else
/* for modules, src is discovered at runtime */
ksyms[index].src = 0;

View File

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

View File

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