ops - omited from previous delta
[binutils-gdb.git] / bfd / elflink.c
index 1b1548a707ca13db47fe4367b2b3a320b8f9f3cb..e9fb64d04727ce3fc22af04aec94f9c3255cc13a 100644 (file)
@@ -41,9 +41,17 @@ _bfd_elf_create_got_section (abfd, info)
 
   switch (bed->s->arch_size)
     {
-    case 32: ptralign = 2; break;
-    case 64: ptralign = 3; break;
-    default: abort();
+    case 32:
+      ptralign = 2;
+      break;
+
+    case 64:
+      ptralign = 3;
+      break;
+
+    default:
+      bfd_set_error (bfd_error_bad_value);
+      return false;
     }
 
   flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
@@ -104,9 +112,17 @@ _bfd_elf_create_dynamic_sections (abfd, info)
 
   switch (bed->s->arch_size)
     {
-    case 32: ptralign = 2; break;
-    case 64: ptralign = 3; break;
-    default: abort();
+    case 32:
+      ptralign = 2;
+      break;
+
+    case 64:
+      ptralign = 3;
+      break;
+
+    default:
+      bfd_set_error (bfd_error_bad_value);
+      return false;
     }
 
   /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
@@ -226,19 +242,12 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
        {
        case STV_INTERNAL:
        case STV_HIDDEN:
-         /* This symbol must be defined in the shared object or
-            executable.  */
-         if (h->root.type == bfd_link_hash_undefined)
+         if (h->root.type != bfd_link_hash_undefined
+             && h->root.type != bfd_link_hash_undefweak)
            {
-             bfd * abfd = h->root.u.undef.abfd;
-             const char * name = h->root.root.string;
-             
-             (*info->callbacks->undefined_symbol)
-               (info, name, abfd, bfd_und_section_ptr, 0, true);
+             h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+             return true;
            }
-         
-         h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
-         return true;
 
        default:
          break;