* som.c (som_reloc_skip): Correct off-by-one error for 4-byte

R_NO_RELOCATION fixups.
	(bfd_section_from_som_symbol): Return the absolute section if the
	symbol isn't contained in any section in the output file.
	(som_slurp_symbol_table): ST_PRI_PROG and ST_SEC_PROG symbols are
	not function symbols (they are magic code labels which *can* be the
	targets of cross space branches).  $START$ is not a section symbol.
This commit is contained in:
Jeff Law 1994-09-13 04:06:07 +00:00
parent c570d36139
commit c7ca67cb67
2 changed files with 26 additions and 10 deletions

View File

@ -1,3 +1,13 @@
Mon Sep 12 21:56:20 1994 Jeff Law (law@snake.cs.utah.edu)
* som.c (som_reloc_skip): Correct off-by-one error for 4-byte
R_NO_RELOCATION fixups.
(bfd_section_from_som_symbol): Return the absolute section if the
symbol isn't contained in any section in the output file.
(som_slurp_symbol_table): ST_PRI_PROG and ST_SEC_PROG symbols are
not function symbols (they are magic code labels which *can* be the
targets of cross space branches). $START$ is not a section symbol.
Mon Sep 12 11:43:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) Mon Sep 12 11:43:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
* coff-alpha.c (ecoffalpha_little_vec): Add SEC_CODE and SEC_DATA * coff-alpha.c (ecoffalpha_little_vec): Add SEC_CODE and SEC_DATA

View File

@ -1187,8 +1187,8 @@ som_reloc_skip (abfd, skip, p, subspace_reloc_sizep, queue)
else if (skip > 0) else if (skip > 0)
{ {
bfd_put_8 (abfd, R_NO_RELOCATION + 31, p); bfd_put_8 (abfd, R_NO_RELOCATION + 31, p);
bfd_put_8 (abfd, skip >> 16, p + 1); bfd_put_8 (abfd, (skip - 1) >> 16, p + 1);
bfd_put_16 (abfd, skip, p + 2); bfd_put_16 (abfd, skip - 1, p + 2);
p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 4, queue); p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 4, queue);
} }
return p; return p;
@ -3664,8 +3664,10 @@ bfd_section_from_som_symbol (abfd, symbol)
if (section->target_index == index) if (section->target_index == index)
return section; return section;
/* Should never happen. */ /* Could be a symbol from an external library (such as an OMOS
abort(); shared library). Don't abort. */
return &bfd_abs_section;
} }
else else
{ {
@ -3680,8 +3682,10 @@ bfd_section_from_som_symbol (abfd, symbol)
return section; return section;
} }
/* Should never happen. */ /* Could be a symbol from an external library (such as an OMOS
abort (); shared library). Don't abort. */
return &bfd_abs_section;
} }
} }
@ -3774,8 +3778,6 @@ som_slurp_symbol_table (abfd)
switch (bufp->symbol_type) switch (bufp->symbol_type)
{ {
case ST_ENTRY: case ST_ENTRY:
case ST_PRI_PROG:
case ST_SEC_PROG:
case ST_MILLICODE: case ST_MILLICODE:
sym->symbol.flags |= BSF_FUNCTION; sym->symbol.flags |= BSF_FUNCTION;
sym->symbol.value &= ~0x3; sym->symbol.value &= ~0x3;
@ -3783,6 +3785,8 @@ som_slurp_symbol_table (abfd)
case ST_STUB: case ST_STUB:
case ST_CODE: case ST_CODE:
case ST_PRI_PROG:
case ST_SEC_PROG:
sym->symbol.value &= ~0x3; sym->symbol.value &= ~0x3;
/* If the symbol's scope is ST_UNSAT, then these are /* If the symbol's scope is ST_UNSAT, then these are
undefined function symbols. */ undefined function symbols. */
@ -3832,9 +3836,11 @@ som_slurp_symbol_table (abfd)
break; break;
} }
/* Mark section symbols and symbols used by the debugger. */ /* 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] == '$' if (sym->symbol.name[0] == '$'
&& sym->symbol.name[strlen (sym->symbol.name) - 1] == '$') && sym->symbol.name[strlen (sym->symbol.name) - 1] == '$'
&& strcmp (sym->symbol.name, "$START$"))
sym->symbol.flags |= BSF_SECTION_SYM; sym->symbol.flags |= BSF_SECTION_SYM;
else if (!strncmp (sym->symbol.name, "L$0\002", 4)) else if (!strncmp (sym->symbol.name, "L$0\002", 4))
{ {