Unified · Split
| @@ -241,6 +241,8 @@ ST_FUNC int add_elf_sym(Section *s, uplong value, unsigned long size, · 240 unmodified lines | ||
| 241 | 241 | goto do_patch; |
| 242 | 242 | } else if (sym_bind == STB_WEAK && esym_bind == STB_GLOBAL) { |
| 243 | 243 | /* 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 */ | |
| 244 | 246 | } else if (sym_vis == STV_HIDDEN || sym_vis == STV_INTERNAL) { |
| 245 | 247 | /* ignore hidden symbols after */ |
| 246 | 248 | } else if (esym->st_shndx == SHN_COMMON |