Messages in this thread | | | Subject | Re: [PATCH v3] modpost: check for static EXPORT_SYMBOL* functions | From | Denis Efremov <> | Date | Tue, 30 Jul 2019 19:44:49 +0300 |
| |
On 30.07.2019 19:29, Masahiro Yamada wrote: > I prefer this, but why do you need to check type? > > Doesn't this work? > > for (sym = info.symtab_start; sym < info.symtab_stop; sym++) { > unsigned char bind = ELF_ST_BIND(sym->st_info); > > struct symbol *s = find_symbol(remove_dot(info.strtab + > sym->st_name)); > > if (s && (bind == STB_GLOBAL || bind == STB_WEAK)) > s->is_static = 0; > }
This works. However, I thought it will be too costly to call find_symbol on each symbol. Hence, 'type == STT_OBJECT || type == STT_FUNC || type == STT_NOTYPE' is a small performance optimization because we need to check only variables and functions. Is it worth to remove it in v4?
Denis
| |