s = dup;
while (*s) {
- struct symbol *func;
+ bool found = false;
+ struct symbol *sym;
char *comma;
comma = strchr(s, ',');
if (comma)
*comma = '\0';
- func = find_symbol_by_name(file->elf, s);
- if (!func || !is_func_sym(func))
+ for_each_sym_by_name(file->elf, s, sym) {
+ if (!is_func_sym(sym))
+ continue;
+ sym->debug_checksum = 1;
+ found = true;
+ }
+
+ if (!found)
WARN("--debug-checksum: can't find '%s'", s);
- else
- func->debug_checksum = 1;
if (!comma)
break;
#define for_each_sym_continue(elf, sym) \
list_for_each_entry_continue(sym, &elf->symbols, global_list)
+#define for_each_sym_by_name(elf, _name, sym) \
+ elf_hash_for_each_possible(elf, symbol_name, sym, name_hash, \
+ str_hash_demangled(_name)) \
+ if (strcmp(sym->name, _name)) {} else
+
#define for_each_sym_by_demangled_name(elf, name, sym) \
elf_hash_for_each_possible(elf, symbol_name, sym, name_hash, \
str_hash(name)) \