]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2000-05-23 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 23 May 2000 14:05:50 +0000 (14:05 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 23 May 2000 14:05:50 +0000 (14:05 +0000)
* elf32-i386.c (elf_i386_relocate_section): Don't allow the
undefined symbol with the non-default visibility attributes.
* elf-hppa.h (elf_hppa_relocate_section): Likewise.
* elf32-arm.h (elf32_arm_relocate_section): Likewise.
* elf32-i370.c (i370_elf_relocate_section): Likewise.
* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
* elf32-mips.c (mips_elf_calculate_relocation): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf64-ia64.c (elf64_ia64_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.

13 files changed:
bfd/ChangeLog
bfd/elf-hppa.h
bfd/elf32-arm.h
bfd/elf32-i370.c
bfd/elf32-i386.c
bfd/elf32-m68k.c
bfd/elf32-mcore.c
bfd/elf32-mips.c
bfd/elf32-ppc.c
bfd/elf32-sparc.c
bfd/elf64-alpha.c
bfd/elf64-ia64.c
bfd/elf64-sparc.c

index e5b040dcf6695bc26e0409f15ff35d50e1b61341..06166285322e802a952a1390b4481f9b10328d02 100644 (file)
@@ -1,3 +1,19 @@
+2000-05-23  H.J. Lu  <hjl@gnu.org>
+
+       * elf32-i386.c (elf_i386_relocate_section): Don't allow the
+       undefined symbol with the non-default visibility attributes.
+       * elf-hppa.h (elf_hppa_relocate_section): Likewise.
+       * elf32-arm.h (elf32_arm_relocate_section): Likewise.
+       * elf32-i370.c (i370_elf_relocate_section): Likewise.
+       * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+       * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
+       * elf32-mips.c (mips_elf_calculate_relocation): Likewise.
+       * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+       * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+       * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+       * elf64-ia64.c (elf64_ia64_relocate_section): Likewise.
+       * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
 2000-05-22  Richard Henderson  <rth@cygnus.com>
 
        * elf64-ia64.c (ia64_howto_table): Add PCREL60B, PCREL21BI,
index e30f714adee5c0cca7977c82ae1ef1fa9808bd65..dab039b09abf90b0b319781358b5bad11ad92fc8 100644 (file)
@@ -1341,7 +1341,8 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
                relocation = 0;
            }
          /* Allow undefined symbols in shared libraries.  */
-          else if (info->shared && !info->no_undefined)
+          else if (info->shared && !info->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            {
              if (info->symbolic)
                (*info->callbacks->undefined_symbol)
index fce233197fdc0025451fd149ac4ac0d549a8a61d..e655781bde6a60fcd7a20555d19d1f85e3336ac8 100644 (file)
@@ -1838,14 +1838,17 @@ elf32_arm_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->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
              if (!((*info->callbacks->undefined_symbol)
                    (info, h->root.root.string, input_bfd,
                     input_section, rel->r_offset,
-                    (!info->shared || info->no_undefined))))
+                    (!info->shared || info->no_undefined
+                     || ELF_ST_VISIBILITY (h->other)))))
                return false;
              relocation = 0;
            }
index c8bf94326cdecdde83351049fba567e48f062320..0715d86d08117cf2ba93171ee176a3db509eac66 100644 (file)
@@ -1413,7 +1413,8 @@ i370_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)
+         else if (info->shared
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
index 8434053f2dfbebc082403673d829148eb9ec8f54..53edaaf254381a0f6a78705b6672f0bf4e64dac0 100644 (file)
@@ -1390,14 +1390,17 @@ elf_i386_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->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd,
                      input_section, rel->r_offset,
-                     (!info->shared || info->no_undefined))))
+                     (!info->shared || info->no_undefined
+                      || ELF_ST_VISIBILITY (h->other)))))
                return false;
              relocation = 0;
            }
index 38e6e9cb395411d4c6db5a09407ecc3d8f483332..b01523477b46a62d5dbb2529e2d0e0127ddce7d5 100644 (file)
@@ -1479,14 +1479,17 @@ 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 && !info->no_undefined)
+         else if (info->shared && !info->symbolic
+                  && !info->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
              if (!(info->callbacks->undefined_symbol
                    (info, h->root.root.string, input_bfd,
                     input_section, rel->r_offset,
-                    (!info->shared || info->no_undefined))))
+                    (!info->shared || info->no_undefined
+                     || ELF_ST_VISIBILITY (h->other)))))
                return false;
              relocation = 0;
            }
index 7e0c30c6cd8e25e8873f0104836dc78ff931e130..99e9c73596e6a9b75da947294ffdb26455c60bf2 100644 (file)
@@ -522,7 +522,8 @@ mcore_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)
+         else if (info->shared
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
index 4892d5afd3d772fc33c259e44a227fadaf67885f..1d258b045074f4a18d5c064b11447bd39a6b53ef 100644 (file)
@@ -5917,7 +5917,8 @@ 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->no_undefined
+              && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
        symbol = 0;
       else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0)
        {
@@ -5935,7 +5936,8 @@ mips_elf_calculate_relocation (abfd,
          if (! ((*info->callbacks->undefined_symbol)
                 (info, h->root.root.root.string, input_bfd,
                  input_section, relocation->r_offset,
-                 (!info->shared || info->no_undefined))))
+                 (!info->shared || info->no_undefined
+                  || ELF_ST_VISIBILITY (h->other)))))
            return bfd_reloc_undefined;
          symbol = 0;
        }
index b7e8592ef7d76ae6d03af01259f370150d634463..cf832426d9f9c6b542a25c7427610ec063e879dc 100644 (file)
@@ -3091,7 +3091,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->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
@@ -3101,7 +3103,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                                         input_section,
                                                         rel->r_offset,
                                                         (!info->shared
-                                                         || info->no_undefined)))
+                                                         || info->no_undefined
+                                                         ELF_ST_VISIBILITY (h->other))))
                return false;
              relocation = 0;
            }
index e61a82fabeb5cc8a0134068635ecb107e86afd8b..1c8d0ba275ae583cd3223e499950ea3aca8d5540 100644 (file)
@@ -1213,14 +1213,17 @@ 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 && !info->no_undefined)
+         else if (info->shared && !info->symbolic
+                  && !info->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd,
                      input_section, rel->r_offset,
-                     (!info->shared || info->no_undefined))))
+                     (!info->shared || info->no_undefined
+                      || ELF_ST_VISIBILITY (h->other)))))
                return false;
              relocation = 0;
            }
index 4da9e925c636ea645570f3f90a06a3d829e5930d..c8fac5361ec9b60bec03392010cfef3d084867b4 100644 (file)
@@ -3475,14 +3475,17 @@ 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 && !info->no_undefined)
+         else if (info->shared && !info->symbolic
+                  && !info->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
              if (!((*info->callbacks->undefined_symbol)
                    (info, h->root.root.root.string, input_bfd,
                     input_section, rel->r_offset,
-                    (!info->shared || info->no_undefined))))
+                    (!info->shared || info->no_undefined
+                     || ELF_ST_VISIBILITY (h->other)))))
                return false;
              relocation = 0;
            }
index ed9f8e3ec941c4450e5ef35eb4cd6b0bda800c81..2fafeb18b29baa325a271e2f6a051a9153c6f89d 100644 (file)
@@ -3258,14 +3258,17 @@ elf64_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 && !info->no_undefined)
+         else if (info->shared && !info->symbolic
+                  && !info->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            ;
          else
            {
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd,
                      input_section, rel->r_offset,
-                     (!info->shared || info->no_undefined))))
+                     (!info->shared || info->no_undefined
+                      || ELF_ST_VISIBILITY (h->other)))))
                return false;
              ret_val = false;
              continue;
index 46e777552f2aac9c5d42088a1aa3f662bafa9332..c9e862677ac767aa0040c3244e6ec14c7c3651ca 100644 (file)
@@ -2049,14 +2049,17 @@ 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 && !info->no_undefined)
+         else if (info->shared && !info->symbolic
+                  && !info->no_undefined
+                  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
          else
            {
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd,
                      input_section, rel->r_offset,
-                     (!info->shared || info->no_undefined))))
+                     (!info->shared || info->no_undefined
+                      || ELF_ST_VISIBILITY (h->other)))))
                return false;
              relocation = 0;
            }