summaryrefslogtreecommitdiff
path: root/tools/objtool/elf.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-03-09 09:06:57 +0300
committerIngo Molnar <mingo@kernel.org>2016-03-09 12:48:09 +0300
commita196e17198224cacd2d992f12cb6d81d354de82f (patch)
treeca10c5454682ffc63764c667c6c32fc6a4877dfc /tools/objtool/elf.c
parente2a5f18a1ba11e8b1e9ee53b6fca4be12bb5749e (diff)
downloadlinux-a196e17198224cacd2d992f12cb6d81d354de82f.tar.xz
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 <jpoimboe@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at> Cc: Borislav Petkov <bp@alien8.de> Cc: Chris J Arges <chris.j.arges@canonical.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Pedro Alves <palves@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/ee0eca2bba8482aa45758958c5586c00a7b71e62.1457502970.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/objtool/elf.c')
-rw-r--r--tools/objtool/elf.c22
1 files changed, 11 insertions, 11 deletions
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);
}