coordinate info->symbolic and info->allow_shlib_undefined
authorNick Clifton <nickc@redhat.com>
Thu, 20 Sep 2001 10:37:35 +0000 (10:37 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 20 Sep 2001 10:37:35 +0000 (10:37 +0000)
17 files changed:
bfd/ChangeLog
bfd/elf32-cris.c
bfd/elf32-hppa.c
bfd/elf32-i386.c
bfd/elf32-m68k.c
bfd/elf32-mips.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-sparc.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-sparc.c
bfd/elf64-x86-64.c
bfd/elfxx-ia64.c

index e2fb365..2a39f18 100644 (file)
@@ -1,3 +1,23 @@
+2001-09-20  John Reiser  <jreiser@BitWagon.com>
+       
+       * elf32-i386.c (elf_i386_relocate_section): coordinate info->symbolic
+         and info->allow_shlib_undefined.
+       * elf32-cris.c: likewise
+       * elf32-hppa.c: likewise
+       * elf32-m68k.c: likewise
+       * elf32-mips.c: likewise
+       * elf32-ppc.c: likewise
+       * elf32-s390.c: likewise
+       * elf32-sh.c: likewise
+       * elf32-sparc.c: likewise
+       * elf64-alpha.c: likewise
+       * elf64-hppa.c: likewise
+       * elf64-ppc.c: likewise
+       * elf64-s390.c: likewise
+       * elf64-sparc.c: likewise
+       * elf64-x86-64.c: likewise
+       * elfxx-ia64.c: likewise
+
 2001-09-18  Bruno Haible  <haible@clisp.cons.org>
 
        * aoutx.h: Include "safe-ctype.h" instead of <ctype.h>.
index eb9a6f4..0a94c12 100644 (file)
@@ -898,7 +898,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
          else if (info->shared
-                  && !info->symbolic
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
index 68a956c..a774782 100644 (file)
@@ -3679,7 +3679,7 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
                   && ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT
                   && h->elf.type != STT_PARISC_MILLI)
            {
-             if (info->symbolic)
+             if (info->symbolic && !info->allow_shlib_undefined)
                if (!((*info->callbacks->undefined_symbol)
                      (info, h->elf.root.root.string, input_bfd,
                       input_section, rel->r_offset, false)))
index 93dfa5e..82c17ce 100644 (file)
@@ -1549,7 +1549,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            ;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            ;
index 33de899..d381be9 100644 (file)
@@ -1474,7 +1474,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
index 1554cce..14bce73 100644 (file)
@@ -6142,7 +6142,9 @@ mips_elf_calculate_relocation (abfd,
           and check to see if they exist by looking at their
           addresses.  */
        symbol = 0;
-      else if (info->shared && !info->symbolic && !info->no_undefined
+      else if (info->shared
+              && (!info->symbolic || info->allow_shlib_undefined)
+              && !info->no_undefined
               && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
        symbol = 0;
       else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 ||
index 392d4fd..8e7ccd4 100644 (file)
@@ -3106,7 +3106,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic && !info->no_undefined
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
+                  && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
index 873f8b6..64e873c 100644 (file)
@@ -1444,7 +1444,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
index e835156..f8d29d1 100644 (file)
@@ -3114,7 +3114,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic && !info->no_undefined)
+         else if (info->shared
+              && (!info->symbolic || info->allow_shlib_undefined)
+              && !info->no_undefined)
            relocation = 0;
          else
            {
index 1707830..93141a8 100644 (file)
@@ -1237,7 +1237,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
index 79cebc1..00d8184 100644 (file)
@@ -3346,7 +3346,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
            relocation = 0;
index d09a93f..98d6888 100644 (file)
@@ -746,7 +746,8 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
         have yet been processed.  Do something with what we know, as
         this may help reduce memory usage and processing time later.  */
       maybe_dynamic = false;
-      if (h && ((info->shared && ! info->symbolic)
+      if (h && ((info->shared
+                   && (!info->symbolic || info->allow_shlib_undefined) )
                || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                || h->root.type == bfd_link_hash_defweak))
        maybe_dynamic = true;
@@ -973,7 +974,7 @@ elf64_hppa_dynamic_symbol_p (h, info)
   if (h->root.root.string[0] == '$' && h->root.root.string[1] == '$')
     return false;
 
-  if ((info->shared && !info->symbolic)
+  if ((info->shared && (!info->symbolic || info->allow_shlib_undefined))
       || ((h->elf_link_hash_flags
           & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
          == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
index d5a340d..78e9815 100644 (file)
@@ -2847,7 +2847,9 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic && !info->no_undefined)
+         else if (info->shared
+              && (!info->symbolic || info->allow_shlib_undefined)
+              && !info->no_undefined)
            relocation = 0;
          else
            {
index 65041a6..7bc6429 100644 (file)
@@ -1432,7 +1432,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
index 0742e22..f5ba083 100644 (file)
@@ -2069,7 +2069,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
index 24eb9f7..0b8d345 100644 (file)
@@ -1300,7 +1300,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared && !info->symbolic && !info->no_undefined
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
+                  && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
index 4ba4665..d8f1de7 100644 (file)
@@ -1429,7 +1429,7 @@ elfNN_ia64_dynamic_symbol_p (h, info)
       || h->root.type == bfd_link_hash_defweak)
     return true;
 
-  if ((info->shared && !info->symbolic)
+  if ((info->shared && (!info->symbolic || info->allow_shlib_undefined))
       || ((h->elf_link_hash_flags
           & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
          == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
@@ -2020,7 +2020,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
         have yet been processed.  Do something with what we know, as
         this may help reduce memory usage and processing time later.  */
       maybe_dynamic = false;
-      if (h && ((info->shared && ! info->symbolic)
+      if (h && ((info->shared
+                     && (!info->symbolic || info->allow_shlib_undefined))
                || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
                || h->root.type == bfd_link_hash_defweak
                || elfNN_ia64_aix_vec (abfd->xvec)))
@@ -3509,7 +3510,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            undef_weak_ref = true;
-         else if (info->shared && !info->symbolic
+         else if (info->shared
+                  && (!info->symbolic || info->allow_shlib_undefined)
                   && !info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            ;