aboutsummaryrefslogtreecommitdiffstats
path: root/tools/objtool/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/objtool/elf.c')
-rw-r--r--tools/objtool/elf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 0d7983ac63ef..d897702ce742 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -85,6 +85,18 @@ struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset)
85 return NULL; 85 return NULL;
86} 86}
87 87
88struct symbol *find_symbol_containing(struct section *sec, unsigned long offset)
89{
90 struct symbol *sym;
91
92 list_for_each_entry(sym, &sec->symbol_list, list)
93 if (sym->type != STT_SECTION &&
94 offset >= sym->offset && offset < sym->offset + sym->len)
95 return sym;
96
97 return NULL;
98}
99
88struct rela *find_rela_by_dest_range(struct section *sec, unsigned long offset, 100struct rela *find_rela_by_dest_range(struct section *sec, unsigned long offset,
89 unsigned int len) 101 unsigned int len)
90{ 102{