]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Merge from mainline
authorPhil Blundell <philb@gnu.org>
Mon, 16 Oct 2000 17:57:08 +0000 (17:57 +0000)
committerPhil Blundell <philb@gnu.org>
Mon, 16 Oct 2000 17:57:08 +0000 (17:57 +0000)
bfd/ChangeLog
bfd/elf32-arm.h
bfd/elflink.c
bfd/elflink.h

index 5f85aad38a52d1bfc9f41d7ee742322392c00fba..7659ec68400efe3c4749fabc47e3aebca8983d94 100644 (file)
@@ -1,3 +1,34 @@
+2000-10-15  Philip Blundell  <philb@gnu.org>
+
+       From 2000-09-08  Nick Clifton  <nickc@redhat.com>
+       * elf32-arm.h (elf32_arm_merge_private_bfd_data): Do not
+       initialise flags in output bfd if the input bfd is the default
+       architecture with the default flags.
+
+       From 2000-09-03  Philip Blundell  <philb@gnu.org>
+       * elf32-arm.h (elf32_arm_relocate_section): Don't try to relocate
+       references to undefined symbols in debugging sections.
+
+       From 2000-05-30  H.J. Lu  <hjl@gnu.org>
+       * elflink.c (_bfd_elf_link_record_dynamic_symbol): Clear the
+       visibility bits if the symbol is undefined. Correctly handle
+       weak undefined symbols with hidden and internal attributes.
+       * elflink.h (elf_link_add_object_symbols): Always turn the
+       symbol into local if it has the hidden or internal attribute.
+
+       From 2000-05-22  H.J. Lu  <hjl@gnu.org>
+       * elflink.h (elf_link_output_extsym): Clear the visibility
+       field for symbols not defined locally.
+
+       From 2000-05-03  Martin v. Löwis  <loewis@informatik.hu-berlin.de>
+       * elflink.h (elf_link_add_object_symbols): Reset dynindx for
+       hidden and internal symbols.
+       (elf_fix_symbol_flags): Clear NEEDS_PLT for symbols with
+       visibility.
+       * elflink.c (_bfd_elf_link_record_dynamic_symbol): Do not
+       assign a PLT or GOT entry to symbols with hidden and
+       internal visibility.
+
 2000-10-16  Philip Blundell  <pb@futuretv.com>
 
        * configure.in: Set version to 2.10.1.
index eaaf9763b4083327ea128d54aa00a3bf3bc882a3..7cb5bbc23321342b8e6b591f40ba5d1521a5e5a9 100644 (file)
@@ -1756,7 +1756,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
                          (!info->symbolic && h->dynindx != -1)
                          || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
                          )
-                     && ((input_section->flags & SEC_ALLOC) != 0)
+                     && ((input_section->flags & SEC_ALLOC) != 0
+                         /* DWARF will emit R_ARM_ABS32 relocations in its
+                            sections against symbols defined externally
+                            in shared libraries.  We can't do anything
+                            with them here.  */
+                         || ((input_section->flags & SEC_DEBUGGING) != 0
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
                      )
                    relocation_needed = 0;
                  break;
@@ -1994,13 +2001,14 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd)
 
   if (!elf_flags_init (obfd))
     {
-      /* If the input is the default architecture then do not
-         bother setting the flags for the output architecture,
-         instead allow future merges to do this.  If no future
-         merges ever set these flags then they will retain their
-         unitialised values, which surprise surprise, correspond
+      /* If the input is the default architecture and had the default
+        flags then do not bother setting the flags for the output
+        architecture, instead allow future merges to do this.  If no
+        future merges ever set these flags then they will retain their
+         uninitialised values, which surprise surprise, correspond
          to the default values.  */
-      if (bfd_get_arch_info (ibfd)->the_default)
+      if (bfd_get_arch_info (ibfd)->the_default
+         && elf_elfheader (ibfd)->e_flags == 0)
        return true;
 
       elf_flags_init (obfd) = true;
index 6534d84b18a0681d1585ad61b02d67e46350a0ad..c593e496f95ccc27391737d7f26c3047d24a6830 100644 (file)
@@ -235,11 +235,17 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
              
              (*info->callbacks->undefined_symbol)
                (info, name, abfd, bfd_und_section_ptr, 0, true);
+
+             /* We have flaged a fatal error. We now treat this as
+                a normal symbol to avoid further error messages. */
+             h->other ^= ELF_ST_VISIBILITY (h->other);
            }
-         
-         h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
-         break;
-         
+         else if (h->root.type != bfd_link_hash_undefweak)
+           {
+             h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+             return true;
+           }
+
        default:
          break;
        }
index bddf290711983dbc640f07a3aa941a4b9d2ba4a6..0230892553c7e7927ad5b392f833a60ba50f2816 100644 (file)
@@ -1852,6 +1852,18 @@ elf_link_add_object_symbols (abfd, info)
                    goto error_return;
                }
            }
+         else if (dynsym && h->dynindx != -1)
+           /* If the symbol already has a dynamic index, but
+              visibility says it should not be visible, turn it into
+              a local symbol.  */
+           switch (ELF_ST_VISIBILITY (h->other))
+             {
+             case STV_INTERNAL:
+             case STV_HIDDEN:  
+               h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+               (*bed->elf_backend_hide_symbol) (h);
+               break;
+             }
        }
     }
 
@@ -3339,10 +3351,12 @@ elf_fix_symbol_flags (h, eif)
   /* If -Bsymbolic was used (which means to bind references to global
      symbols to the definition within the shared object), and this
      symbol was defined in a regular object, then it actually doesn't
-     need a PLT entry.  */
+     need a PLT entry.  Likewise, if the symbol has any kind of
+     visibility (internal, hidden, or protected), it doesn't need a
+     PLT.  */
   if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
       && eif->info->shared
-      && eif->info->symbolic
+      && (eif->info->symbolic || ELF_ST_VISIBILITY (h->other))
       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
     {
       h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
@@ -5072,6 +5086,11 @@ elf_link_output_extsym (h, data)
       sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
     }
 
+  /* If a symbol is not defined locally, we clear the visibility
+     field. */
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+    sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other);
+
   /* If this symbol should be put in the .dynsym section, then put it
      there now.  We have already know the symbol index.  We also fill
      in the entry in the .hash section.  */