* som.c (som_prep_for_fixups): A relocation involving the section
[deliverable/binutils-gdb.git] / bfd / som.c
index 02c4dab56c9a375540131cbe3b5c7af356c41219..d399e0f11e3ff2f04b3bb0054b5d402773097dff 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -2126,8 +2126,11 @@ som_prep_for_fixups (abfd, syms, num_syms)
          arelent *reloc = section->orelocation[i];
          int scale;
 
-         /* If no symbol, then there is no counter to increase.  */
-         if (reloc->sym_ptr_ptr == NULL)
+         /* A relocation against a symbol in the *ABS* section really
+            does not have a symbol.  Likewise if the symbol isn't associated
+            with any section.  */
+         if (reloc->sym_ptr_ptr == NULL
+             || (*reloc->sym_ptr_ptr)->section == &bfd_abs_section)
            continue;
 
          /* Scaling to encourage symbols involved in R_DP_RELATIVE 
@@ -3509,7 +3512,6 @@ som_slurp_symbol_table (abfd)
        /* symbol_info field is undefined for SS_EXTERNAL and SS_UNSAT symbols,
           so the section associated with this symbol can't be known.  */
        case SS_EXTERNAL:
-       case SS_UNSAT:
          if (bufp->symbol_type != ST_STORAGE)
            sym->symbol.section = &bfd_und_section;
          else
@@ -3517,6 +3519,13 @@ som_slurp_symbol_table (abfd)
          sym->symbol.flags |= (BSF_EXPORT | BSF_GLOBAL);
          break;
 
+       case SS_UNSAT:
+         if (bufp->symbol_type != ST_STORAGE)
+           sym->symbol.section = &bfd_und_section;
+         else
+           sym->symbol.section = &bfd_com_section;
+         break;
+
        case SS_UNIVERSAL:
          sym->symbol.flags |= (BSF_EXPORT | BSF_GLOBAL);
          sym->symbol.section
@@ -3537,11 +3546,10 @@ som_slurp_symbol_table (abfd)
          break;
        }
 
-      /* Mark symbols left around by the debugger.  */
-      if (strlen (sym->symbol.name) >= 2
-         && sym->symbol.name[0] == 'L'
-         && (sym->symbol.name[1] == '$' || sym->symbol.name[2] == '$'
-             || sym->symbol.name[3] == '$'))
+      /* Mark section symbols and symbols used by the debugger.  */
+      if (!strcmp (sym->symbol.name, "L$0\002"))
+       sym->symbol.flags |= BSF_SECTION_SYM;
+      else if (!strncmp (sym->symbol.name, "L$0", 3))
        sym->symbol.flags |= BSF_DEBUGGING;
 
       /* Note increment at bottom of loop, since we skip some symbols
This page took 0.024704 seconds and 4 git commands to generate.