]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-05-11 Daniel Jacobowitz <drow@mvista.com>
authorDaniel Jacobowitz <drow@false.org>
Sat, 11 May 2002 18:05:35 +0000 (18:05 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sat, 11 May 2002 18:05:35 +0000 (18:05 +0000)
        Merge from mainline (to elf32-mips.c):
        2002-05-03  H.J. Lu  (hjl@gnu.org)

        * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
        (mips_elf_link_hash_newfunc): Initialize forced_local to false.
        (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
        to hide a global symbol.
        (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
        forced_local to true.

bfd/ChangeLog
bfd/elf32-mips.c

index eb836c3b2e36061fc287b4ff8391d756e8b2efca..b820156812915e97d1d922a9eccddcc217b58ec4 100644 (file)
@@ -1,5 +1,17 @@
+2002-05-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       Merge from mainline (to elf32-mips.c):
+       2002-05-03  H.J. Lu  (hjl@gnu.org)
+
+       * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
+       (mips_elf_link_hash_newfunc): Initialize forced_local to false.
+       (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
+       to hide a global symbol.
+       (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
+       forced_local to true. 
+
 2002-05-11  Ralf Corsepius  <corsepiu@faw.uni-ulm.de>
-            Daniel Jacobowitz  <drow@mvista.com>
+           Daniel Jacobowitz  <drow@mvista.com>
 
        * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE.  Don't
        map BFD_RELOC_RVA.
index e7b470146955703ac14a96a5bf2395719aa5dd05..ddfe4a0e7300965dc8fe8381641a988ea59d3e5d 100644 (file)
@@ -105,6 +105,9 @@ struct mips_elf_link_hash_entry
   /* This is like the call_stub field, but it is used if the function
      being called returns a floating point value.  */
   asection *call_fp_stub;
+
+  /* Are we forced local?  .*/
+  boolean forced_local;
 };
 
 static bfd_reloc_status_type mips32_64bit_reloc
@@ -4528,6 +4531,7 @@ mips_elf_link_hash_newfunc (entry, table, string)
       ret->need_fn_stub = false;
       ret->call_stub = NULL;
       ret->call_fp_stub = NULL;
+      ret->forced_local = false;
     }
 
   return (struct bfd_hash_entry *) ret;
@@ -4543,7 +4547,12 @@ _bfd_mips_elf_hide_symbol (info, entry, force_local)
   asection *got;
   struct mips_got_info *g;
   struct mips_elf_link_hash_entry *h;
+
   h = (struct mips_elf_link_hash_entry *) entry;
+  if (h->forced_local)
+    return;
+  h->forced_local = true;
+
   dynobj = elf_hash_table (info)->dynobj;
   got = bfd_get_section_by_name (dynobj, ".got");
   g = (struct mips_got_info *) elf_section_data (got)->tdata;
@@ -6047,9 +6056,18 @@ mips_elf_record_global_got_symbol (h, info, g)
 {
   /* A global symbol in the GOT must also be in the dynamic symbol
      table.  */
-  if (h->dynindx == -1
-      && !bfd_elf32_link_record_dynamic_symbol (info, h))
-    return false;
+  if (h->dynindx == -1)
+    {
+      switch (ELF_ST_VISIBILITY (h->other))
+       {
+       case STV_INTERNAL:
+       case STV_HIDDEN:
+         _bfd_mips_elf_hide_symbol (info, h, true);
+         break;
+       }
+      if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+       return false;
+    }
 
   /* If we've already marked this entry as needing GOT space, we don't
      need to do it again.  */