* som.c (som_misc_symbol_info): Add field
authorCatherine Moore <clm@redhat.com>
Thu, 24 Feb 2000 13:41:02 +0000 (13:41 +0000)
committerCatherine Moore <clm@redhat.com>
Thu, 24 Feb 2000 13:41:02 +0000 (13:41 +0000)
        secondary_def.
        (som_bfd_derive_misc_symbol_info):  Initialize
        secondary_def.
        (som_build_and_write_symbol_table): Keep track
        of secondary_def field.
        (som_slurp_symbol_table): Set BSF_WEAK symbol flag
        if secondary_def field is set.
        (som_bfd_ar_write_symbol_stuff): Initialize
        secondary_def.

bfd/ChangeLog
bfd/som.c

index 3534c54bb8d3837811d30bd10b1809af81fb4d3e..32b94ce6355b1aad1dee296bf9cd44fabb330c38 100644 (file)
@@ -1,3 +1,16 @@
+2000-02-24  Catherine Moore  <clm@cygnus.com>
+
+       * som.c (som_misc_symbol_info):  Add field
+       secondary_def. 
+       (som_bfd_derive_misc_symbol_info):  Initialize
+       secondary_def.
+       (som_build_and_write_symbol_table): Keep track
+       of secondary_def field.
+       (som_slurp_symbol_table): Set BSF_WEAK symbol flag
+       if secondary_def field is set.
+       (som_bfd_ar_write_symbol_stuff): Initialize
+       secondary_def.
+
 2000-02-23  Stephane Carrez  <stcarrez@worldnet.fr>
 
        * dwarf2.c (read_address): Read 16-bits addresses.
index 6f2b6c3abd6fd66616ee2460f9c30e8b122c7a3a..492ac2307face33ea1b1926c18c17bbef2b9f90e 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -148,6 +148,7 @@ struct som_misc_symbol_info
   unsigned int symbol_info;
   unsigned int symbol_value;
   unsigned int priv_level;
+  unsigned int secondary_def;
 };
 
 /* Forward declarations */
@@ -4052,6 +4053,13 @@ som_bfd_derive_misc_symbol_info (abfd, sym, info)
 
   /* Set the symbol's value.  */
   info->symbol_value = sym->value + sym->section->vma;
+
+  /* The secondary_def field is for weak symbols.  */
+  if (sym->flags & BSF_WEAK)
+    info->secondary_def = true;
+  else
+    info->secondary_def = false;
+
 }
 
 /* Build and write, in one big chunk, the entire symbol table for
@@ -4095,6 +4103,7 @@ som_build_and_write_symbol_table (abfd)
       som_symtab[i].symbol_info = info.symbol_info;
       som_symtab[i].xleast = 3;
       som_symtab[i].symbol_value = info.symbol_value | info.priv_level;
+      som_symtab[i].secondary_def = info.secondary_def;
     }
 
   /* Everything is ready, seek to the right location and
@@ -4382,6 +4391,10 @@ som_slurp_symbol_table (abfd)
          break;
        }
 
+      /* Check for a weak symbol.  */
+      if (bufp->secondary_def)
+        sym->symbol.flags |= BSF_WEAK;
+
       /* Mark section symbols and symbols used by the debugger.
         Note $START$ is a magic code symbol, NOT a section symbol.  */
       if (sym->symbol.name[0] == '$'
@@ -5924,7 +5937,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength)
 
          /* Fill in the lst symbol record.  */
          curr_lst_sym->hidden = 0;
-         curr_lst_sym->secondary_def = 0;
+         curr_lst_sym->secondary_def = info.secondary_def;
          curr_lst_sym->symbol_type = info.symbol_type;
          curr_lst_sym->symbol_scope = info.symbol_scope;
          curr_lst_sym->check_level = 0;
This page took 0.030942 seconds and 4 git commands to generate.