if (sym == NULL)
goto out_delete_line;
+ /*
+ * We will pass the symbols to the filter later, in
+ * kernel_maps__split_kallsyms, when we have split the
+ * maps per module
+ */
dso__insert_symbol(kernel_map->dso, sym);
}
* And always look at the original dso, not at debuginfo packages, that
* have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS).
*/
-static int dso__synthesize_plt_symbols(struct dso *self)
+static int dso__synthesize_plt_symbols(struct dso *self, struct map *map,
+ symbol_filter_t filter)
{
uint32_t nr_rel_entries, idx;
GElf_Sym sym;
if (!f)
goto out_elf_end;
- dso__insert_symbol(self, f);
- ++nr;
+ if (filter && filter(map, f))
+ symbol__delete(f);
+ else {
+ dso__insert_symbol(self, f);
+ ++nr;
+ }
}
} else if (shdr_rel_plt.sh_type == SHT_REL) {
GElf_Rel pos_mem, *pos;
if (!f)
goto out_elf_end;
- dso__insert_symbol(self, f);
- ++nr;
+ if (filter && filter(map, f))
+ symbol__delete(f);
+ else {
+ dso__insert_symbol(self, f);
+ ++nr;
+ }
}
}
goto more;
if (ret > 0) {
- int nr_plt = dso__synthesize_plt_symbols(self);
+ int nr_plt = dso__synthesize_plt_symbols(self, map, filter);
if (nr_plt > 0)
ret += nr_plt;
}