History

tccelf: allow multiply defined weak symbols

Joe Soroka committed 15 years ago

Commit 585027a1 parent e23194a1 file · +2 −0Browse files

Unified · Split

tccelf.c+2−0
@@ -241,6 +241,8 @@ ST_FUNC int add_elf_sym(Section *s, uplong value, unsigned long size, · 240 unmodified lines
241241 goto do_patch;
242242 } else if (sym_bind == STB_WEAK && esym_bind == STB_GLOBAL) {
243243 /* weak is ignored if already global */
244+ } else if (sym_bind == STB_WEAK && esym_bind == STB_WEAK) {
245+ /* keep first-found weak definition, ignore subsequents */
244246 } else if (sym_vis == STV_HIDDEN || sym_vis == STV_INTERNAL) {
245247 /* ignore hidden symbols after */
246248 } else if (esym->st_shndx == SHN_COMMON