support weak attribute on variables

This commit is contained in:
Joe Soroka
2011-02-01 00:37:53 -08:00
parent 6839382480
commit 4d5105c8f1
4 changed files with 29 additions and 4 deletions

View File

@ -429,7 +429,7 @@ ST_FUNC void put_extern_sym2(Sym *sym, Section *section,
if (sym->type.t & VT_STATIC)
sym_bind = STB_LOCAL;
else {
if (sym_type == STT_FUNC && sym->type.ref && FUNC_WEAK(sym->type.ref->r))
if (sym->type.t & VT_WEAK)
sym_bind = STB_WEAK;
else
sym_bind = STB_GLOBAL;