+/* Mark if a symbol has a definition in a dynamic object or is
+ weak in all dynamic objects. */
+
+static void
+_bfd_elf_mark_dynamic_def_weak (struct elf_link_hash_entry *h,
+ asection *sec, int bind)
+{
+ if (!h->dynamic_def)
+ {
+ if (!bfd_is_und_section (sec))
+ h->dynamic_def = 1;
+ else
+ {
+ /* Check if this symbol is weak in all dynamic objects. If it
+ is the first time we see it in a dynamic object, we mark
+ if it is weak. Otherwise, we clear it. */
+ if (!h->ref_dynamic)
+ {
+ if (bind == STB_WEAK)
+ h->dynamic_weak = 1;
+ }
+ else if (bind != STB_WEAK)
+ h->dynamic_weak = 0;
+ }
+ }
+}
+