aboutsummaryrefslogtreecommitdiff
path: root/bfd/som.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-03-15 05:21:51 +0000
committerJeff Law <law@redhat.com>1994-03-15 05:21:51 +0000
commitbaef2065d089cf8bf5bff6cd29699b65836cb3c6 (patch)
tree8cda342089f0017c711f3563b5f3cb84c5704fa6 /bfd/som.c
parentb486fb13bef51495396bf43c40aecd2d9d356b98 (diff)
downloadgdb-baef2065d089cf8bf5bff6cd29699b65836cb3c6.zip
gdb-baef2065d089cf8bf5bff6cd29699b65836cb3c6.tar.gz
gdb-baef2065d089cf8bf5bff6cd29699b65836cb3c6.tar.bz2
* som.c (som_prep_for_fixups): A relocation involving the section
symbol for the *ABS* section is really a relocation involving no symbol. (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for undefined symbols. Correctly distinguish between debugger symbols and section symbols.
Diffstat (limited to 'bfd/som.c')
-rw-r--r--bfd/som.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/bfd/som.c b/bfd/som.c
index 02c4dab..d399e0f 100644
--- 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