From ecba7a3a1aa79f341f0b1574e05e634a617247e5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 26 Apr 1996 22:01:22 +0000 Subject: [PATCH] * som.c (som_slurp_symbol_table): Set the symbol count to the number of BFD symbols created. PR 5332. --- bfd/ChangeLog | 5 +++++ bfd/som.c | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5f1633a198..f1c67f6f2d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 26 18:00:37 1996 Ian Lance Taylor + + * som.c (som_slurp_symbol_table): Set the symbol count to the + number of BFD symbols created. + Fri Apr 26 12:34:29 1996 Michael Meissner * elf32-ppc.c (ppc_elf_check_relocs): Forward relocations to the diff --git a/bfd/som.c b/bfd/som.c index 47ffbb1d9f..a1cf4cd52e 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -1529,6 +1529,34 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff) final_types[2] = NULL; *final_type = base_type; break; + + case e_nsel: + final_types[0] = (int *) bfd_alloc_by_size_t (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_N1SEL; + final_types[1] = final_type; + final_types[2] = NULL; + *final_type = base_type; + break; + + case e_nlsel: + case e_nlrsel: + final_types[0] = (int *) bfd_alloc_by_size_t (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_N0SEL; + final_types[1] = (int *) bfd_alloc_by_size_t (abfd, sizeof (int)); + if (!final_types[1]) + return NULL; + if (field == e_nlsel) + *final_types[1] = R_N_MODE; + else + *final_types[1] = R_R_MODE; + final_types[2] = final_type; + final_types[3] = NULL; + *final_type = base_type; + break; } switch (base_type) @@ -2752,6 +2780,8 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) case R_RSEL: case R_BEGIN_BRTAB: case R_END_BRTAB: + case R_N0SEL: + case R_N1SEL: bfd_put_8 (abfd, bfd_reloc->howto->type, p); subspace_reloc_size += 1; p += 1; @@ -4074,8 +4104,12 @@ som_slurp_symbol_table (abfd) sym++; } - /* Save our results and return success. */ - obj_som_symtab (abfd) = symbase; + /* We modify the symbol count to record the number of BFD symbols we + created. */ + bfd_get_symcount (abfd) = sym - symbase; + + /* Save our results and return success. */ + obj_som_symtab (abfd) = symbase; successful_return: if (buf != NULL) free (buf); -- 2.34.1