From a196e17198224cacd2d992f12cb6d81d354de82f Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Wed, 9 Mar 2016 00:06:57 -0600 Subject: objtool: Rename some variables and functions Rename some list heads to distinguish them from hash node heads, which are added later in the patch series. Also rename the get_*() functions to add_*(), which is more descriptive: they "add" data to the objtool_file struct. Also rename rodata_rela and text_rela to be clearer: - text_rela refers to a rela entry in .rela.text. - rodata_rela refers to a rela entry in .rela.rodata. Signed-off-by: Josh Poimboeuf Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Bernd Petrovitsch Cc: Borislav Petkov Cc: Chris J Arges Cc: Jiri Slaby Cc: Linus Torvalds Cc: Michal Marek Cc: Namhyung Kim Cc: Pedro Alves Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/ee0eca2bba8482aa45758958c5586c00a7b71e62.1457502970.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- tools/objtool/elf.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tools/objtool/elf.c') diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index d547e3f6e0ee..7de243f0a7be 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -59,7 +59,7 @@ static struct symbol *find_symbol_by_index(struct elf *elf, unsigned int idx) struct symbol *sym; list_for_each_entry(sec, &elf->sections, list) - list_for_each_entry(sym, &sec->symbols, list) + list_for_each_entry(sym, &sec->symbol_list, list) if (sym->idx == idx) return sym; @@ -70,7 +70,7 @@ struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset) { struct symbol *sym; - list_for_each_entry(sym, &sec->symbols, list) + list_for_each_entry(sym, &sec->symbol_list, list) if (sym->type != STT_SECTION && sym->offset == offset) return sym; @@ -86,7 +86,7 @@ struct rela *find_rela_by_dest_range(struct section *sec, unsigned long offset, if (!sec->rela) return NULL; - list_for_each_entry(rela, &sec->rela->relas, list) + list_for_each_entry(rela, &sec->rela->rela_list, list) if (rela->offset >= offset && rela->offset < offset + len) return rela; @@ -102,7 +102,7 @@ struct symbol *find_containing_func(struct section *sec, unsigned long offset) { struct symbol *func; - list_for_each_entry(func, &sec->symbols, list) + list_for_each_entry(func, &sec->symbol_list, list) if (func->type == STT_FUNC && offset >= func->offset && offset < func->offset + func->len) return func; @@ -135,8 +135,8 @@ static int read_sections(struct elf *elf) } memset(sec, 0, sizeof(*sec)); - INIT_LIST_HEAD(&sec->symbols); - INIT_LIST_HEAD(&sec->relas); + INIT_LIST_HEAD(&sec->symbol_list); + INIT_LIST_HEAD(&sec->rela_list); list_add_tail(&sec->list, &elf->sections); @@ -244,8 +244,8 @@ static int read_symbols(struct elf *elf) sym->len = sym->sym.st_size; /* sorted insert into a per-section list */ - entry = &sym->sec->symbols; - list_for_each_prev(tmp, &sym->sec->symbols) { + entry = &sym->sec->symbol_list; + list_for_each_prev(tmp, &sym->sec->symbol_list) { struct symbol *s; s = list_entry(tmp, struct symbol, list); @@ -298,7 +298,7 @@ static int read_relas(struct elf *elf) } memset(rela, 0, sizeof(*rela)); - list_add_tail(&rela->list, &sec->relas); + list_add_tail(&rela->list, &sec->rela_list); if (!gelf_getrela(sec->elf_data, i, &rela->rela)) { perror("gelf_getrela"); @@ -382,11 +382,11 @@ void elf_close(struct elf *elf) struct rela *rela, *tmprela; list_for_each_entry_safe(sec, tmpsec, &elf->sections, list) { - list_for_each_entry_safe(sym, tmpsym, &sec->symbols, list) { + list_for_each_entry_safe(sym, tmpsym, &sec->symbol_list, list) { list_del(&sym->list); free(sym); } - list_for_each_entry_safe(rela, tmprela, &sec->relas, list) { + list_for_each_entry_safe(rela, tmprela, &sec->rela_list, list) { list_del(&rela->list); free(rela); } -- cgit v1.2.3