also when generating PIE.
(elf_m68k_discard_copies): Mark undefined weak symbols referenced
by relocations as dynamic.
+2012-04-26 Andreas Schwab <schwab@linux-m68k.org>
+
+ * elf32-m68k.c (elf_m68k_check_relocs): Mark non-GOT references
+ also when generating PIE.
+ (elf_m68k_discard_copies): Mark undefined weak symbols referenced
+ by relocations as dynamic.
+
2012-04-26 Hans-Peter Nilsson <hp@axis.com>
Provide a way for programs to recognize BFD_ASSERT calls.
turns out to be a function defined by a dynamic object. */
h->plt.refcount++;
- if (!info->shared)
+ if (info->executable)
/* This symbol needs a non-GOT reference. */
h->non_got_ref = 1;
}
}
}
+ /* Make sure undefined weak symbols are output as a dynamic symbol
+ in PIEs. */
+ if (h->non_got_ref
+ && h->root.type == bfd_link_hash_undefweak
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ && h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
return TRUE;
}