* Makefile.am (libbfd.h): Add "Extracted from.." comment.
[deliverable/binutils-gdb.git] / bfd / linker.c
index 8d2287239ad80b6c079d7f633ad360e9235585d9..228f088a0175de28aa3689b5714987e48c1bb8d7 100644 (file)
@@ -1813,37 +1813,38 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value,
          /* Fall through.  */
        case MDEF:
          /* Handle a multiple definition.  */
-         {
-           asection *msec = NULL;
-           bfd_vma mval = 0;
+         if (!info->allow_multiple_definition)
+           {
+             asection *msec = NULL;
+             bfd_vma mval = 0;
 
-           switch (h->type)
-             {
-             case bfd_link_hash_defined:
-               msec = h->u.def.section;
-               mval = h->u.def.value;
-               break;
-             case bfd_link_hash_indirect:
-               msec = bfd_ind_section_ptr;
-               mval = 0;
-               break;
-             default:
-               abort ();
-             }
+             switch (h->type)
+               {
+               case bfd_link_hash_defined:
+                 msec = h->u.def.section;
+                 mval = h->u.def.value;
+                 break;
+               case bfd_link_hash_indirect:
+                 msec = bfd_ind_section_ptr;
+                 mval = 0;
+                 break;
+               default:
+                 abort ();
+               }
 
-           /* Ignore a redefinition of an absolute symbol to the same
-               value; it's harmless.  */
-           if (h->type == bfd_link_hash_defined
-               && bfd_is_abs_section (msec)
-               && bfd_is_abs_section (section)
-               && value == mval)
-             break;
+             /* Ignore a redefinition of an absolute symbol to the
+                same value; it's harmless.  */
+             if (h->type == bfd_link_hash_defined
+                 && bfd_is_abs_section (msec)
+                 && bfd_is_abs_section (section)
+                 && value == mval)
+               break;
 
-           if (! ((*info->callbacks->multiple_definition)
-                  (info, h->root.string, msec->owner, msec, mval, abfd,
-                   section, value)))
-             return false;
-         }
+             if (! ((*info->callbacks->multiple_definition)
+                    (info, h->root.string, msec->owner, msec, mval,
+                     abfd, section, value)))
+               return false;
+           }
          break;
 
        case CIND:
This page took 0.025393 seconds and 4 git commands to generate.