2001-06-25 Alan Modra <amodra@bigpond.net.au>
+ * elf32-i386.c (elf_i386_check_relocs <R_386_32, R_386_PC32>):
+ Ensure syms are dynamic if we might be emitting a reloc.
+ (allocate_plt_and_got_and_discard_relocs): Don't discard relocs
+ for undefweak or undefined syms..
+ (elf_i386_relocate_section <R_386_32, R_386_PC32>): .. and emit.
+
* elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Discard
relocs without ELF_LINK_HASH_DEF_DYNAMIC set.
(elf_i386_relocate_section <R_386_32, R_386_PC32>): Remove
this reloc. */
if (dynobj == NULL)
htab->root.dynobj = dynobj = abfd;
+
+ if (h != NULL && h->dynindx == -1)
+ {
+ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ return false;
+ }
+
if (sreloc == NULL)
{
const char *name;
|| (!info->shared
&& (h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) != 0
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
+ || ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && h->root.type != bfd_link_hash_undefweak
+ && h->root.type != bfd_link_hash_undefined))))
{
struct elf_i386_link_hash_entry *eh;
struct elf_i386_dyn_relocs *c;
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
+ && ((h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ || h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined)))
{
Elf_Internal_Rel outrel;
boolean skip, relocate;