* elf64-ppc.c (func_desc_adjust): Only provide missing function
authorAlan Modra <amodra@gmail.com>
Wed, 30 Jan 2002 03:47:37 +0000 (03:47 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 30 Jan 2002 03:47:37 +0000 (03:47 +0000)
descriptor symbols for undefined function code syms.  Clear
ELF_LINK_NON_ELF so that they can stay weak.

bfd/ChangeLog
bfd/elf64-ppc.c

index c9f4121..3525801 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-30  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf64-ppc.c (func_desc_adjust): Only provide missing function
+       descriptor symbols for undefined function code syms.  Clear
+       ELF_LINK_NON_ELF so that they can stay weak.
+
 2002-01-29  Chris Demetriou  <cgd@broadcom.com>
             Mitch Lichtenberg  <mpl@broadcom.com>
 
index da339bb..70407e2 100644 (file)
@@ -2500,20 +2500,15 @@ func_desc_adjust (h, inf)
       fdh = elf_link_hash_lookup (&htab->elf, h->root.root.string + 1,
                                  false, false, true);
 
-      if (fdh == NULL && info->shared)
+      if (fdh == NULL
+         && info->shared
+         && (h->root.type == bfd_link_hash_undefined
+             || h->root.type == bfd_link_hash_undefweak))
        {
          bfd *abfd;
          asymbol *newsym;
 
-         /* Create it as undefined.  */
-         if (h->root.type == bfd_link_hash_undefined
-             || h->root.type == bfd_link_hash_undefweak)
-           abfd = h->root.u.undef.abfd;
-         else if (h->root.type == bfd_link_hash_defined
-                  || h->root.type == bfd_link_hash_defweak)
-           abfd = h->root.u.def.section->owner;
-         else
-           abort ();
+         abfd = h->root.u.undef.abfd;
          newsym = bfd_make_empty_symbol (abfd);
          newsym->name = h->root.root.string + 1;
          newsym->section = bfd_und_section_ptr;
@@ -2529,6 +2524,7 @@ func_desc_adjust (h, inf)
            {
              return false;
            }
+         fdh->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
        }
 
       if (fdh != NULL