2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 5 Apr 2006 13:36:32 +0000 (13:36 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 5 Apr 2006 13:36:32 +0000 (13:36 +0000)
PR ld/2404
* elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
symbol from the dynamic definition with the default version if
its type and the type of existing regular definition mismatch.

bfd/ChangeLog
bfd/elflink.c

index 322b77facd33949bd8feb62ec8d91c40fd06aab4..9f371a802d25ef578cd2c548cb01a85a602a596c 100644 (file)
@@ -1,3 +1,10 @@
+2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/2404
+       * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
+       symbol from the dynamic definition with the default version if
+       its type and the type of existing regular definition mismatch.
+
 2006-04-05  Richard Sandiford  <richard@codesourcery.com>
            Daniel Jacobowitz  <dan@codesourcery.com>
 
index 88e56da54d43e1cf261e47de081bc0d16a4ba1b1..f3098aedfdf4e77b979ba03c8cb62fabfc094855 100644 (file)
@@ -889,6 +889,26 @@ _bfd_elf_merge_symbol (bfd *abfd,
            && h->root.type != bfd_link_hash_undefweak
            && h->root.type != bfd_link_hash_common);
 
+  /* When we try to create a default indirect symbol from the dynamic
+     definition with the default version, we skip it if its type and
+     the type of existing regular definition mismatch.  We only do it
+     if the existing regular definition won't be dynamic.  */
+  if (pold_alignment == NULL
+      && !info->shared
+      && !info->export_dynamic
+      && !h->ref_dynamic
+      && newdyn
+      && newdef
+      && !olddyn
+      && (olddef || h->root.type == bfd_link_hash_common)
+      && ELF_ST_TYPE (sym->st_info) != h->type
+      && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
+      && h->type != STT_NOTYPE)
+    {
+      *skip = TRUE;
+      return TRUE;
+    }
+
   /* Check TLS symbol.  We don't check undefined symbol introduced by
      "ld -u".  */
   if ((ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS)
This page took 0.02819 seconds and 4 git commands to generate.