2003-03-28 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 29 Mar 2003 01:26:33 +0000 (01:26 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 29 Mar 2003 01:26:33 +0000 (01:26 +0000)
* elflink.h (elf_link_add_object_symbols): Correctly combine
visibilities.

bfd/ChangeLog
bfd/elflink.h

index 90791379cd6d2bf76a5b98b194a467990b3fed4b..5d387c06155274e7621fda4df968fb0e1348e459 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-28  H.J. Lu <hjl@gnu.org>
+
+       * elflink.h (elf_link_add_object_symbols): Correctly combine
+       visibilities.
+
 2003-03-27  Jakub Jelinek  <jakub@redhat.com>
 
        * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
index c39120d037bad5d5dc524fde614bbbfadd3f7f7a..3af34ee284d311f46359c027f1f7f43a12b99d02 100644 (file)
@@ -1940,7 +1940,7 @@ elf_link_add_object_symbols (abfd, info)
             might be needed here.  */
          if (isym->st_other != 0)
            {
-             unsigned char hvis, symvis, other;
+             unsigned char hvis, symvis, other, nvis;
 
              /* Take the balance of OTHER from the definition.  */
              other = (definition ? isym->st_other : h->other);
@@ -1949,8 +1949,14 @@ elf_link_add_object_symbols (abfd, info)
              /* Combine visibilities, using the most constraining one.  */
              hvis   = ELF_ST_VISIBILITY (h->other);
              symvis = ELF_ST_VISIBILITY (isym->st_other);
+             if (! hvis)
+               nvis = symvis;
+             else if (! symvis)
+               nvis = hvis;
+             else
+               nvis = hvis < symvis ? hvis : symvis;
 
-             h->other = other | (hvis > symvis ? hvis : symvis);
+             h->other = other | nvis;
            }
 
          /* Set a flag in the hash table entry indicating the type of