lkml.org 
[lkml]   [2019]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] modpost: check for static EXPORT_SYMBOL* functions
From
Date
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

\
 
 \ /
  Last update: 2019-07-30 18:46    [W:0.253 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site