From a2d914e15e2bbc5e29a7deab1b6dab999556f0e3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 16 Apr 1996 17:46:54 +0000 Subject: [PATCH] * coffgen.c (bfd_coff_get_syment): New function. (bfd_coff_get_auxent): New function. * bfd-in.h (bfd_coff_get_syment): Declare. (bfd_coff_get_auxent): Declare. * bfd-in2.h: Rebuild. --- bfd/ChangeLog | 8 ++++++ bfd/coffgen.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e597bded172..029d3ea22d8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +Tue Apr 16 13:44:08 1996 Ian Lance Taylor + + * coffgen.c (bfd_coff_get_syment): New function. + (bfd_coff_get_auxent): New function. + * bfd-in.h (bfd_coff_get_syment): Declare. + (bfd_coff_get_auxent): Declare. + * bfd-in2.h: Rebuild. + Mon Apr 15 19:06:59 1996 Ian Lance Taylor * elf32-mips.c (struct mips_hi16): Define. diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 14df3a3f729..9340fedf18a 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1794,6 +1794,78 @@ coff_get_symbol_info (abfd, symbol, ret) } } +/* Return the COFF syment for a symbol. */ + +boolean +bfd_coff_get_syment (abfd, symbol, psyment) + bfd *abfd; + asymbol *symbol; + struct internal_syment *psyment; +{ + coff_symbol_type *csym; + + csym = coff_symbol_from (abfd, symbol); + if (csym == NULL || csym->native == NULL) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } + + *psyment = csym->native->u.syment; + + if (csym->native->fix_value) + psyment->n_value = ((combined_entry_type *) psyment->n_value + - obj_raw_syments (abfd)); + + /* FIXME: We should handle fix_line here. */ + + return true; +} + +/* Return the COFF auxent for a symbol. */ + +boolean +bfd_coff_get_auxent (abfd, symbol, indx, pauxent) + bfd *abfd; + asymbol *symbol; + int indx; + union internal_auxent *pauxent; +{ + coff_symbol_type *csym; + combined_entry_type *ent; + + csym = coff_symbol_from (abfd, symbol); + + if (csym == NULL + || csym->native == NULL + || indx >= csym->native->u.syment.n_numaux) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } + + ent = csym->native + indx + 1; + + *pauxent = ent->u.auxent; + + if (ent->fix_tag) + pauxent->x_sym.x_tagndx.l = + ((combined_entry_type *) pauxent->x_sym.x_tagndx.p + - obj_raw_syments (abfd)); + + if (ent->fix_end) + pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l = + ((combined_entry_type *) pauxent->x_sym.x_fcnary.x_fcn.x_endndx.p + - obj_raw_syments (abfd)); + + if (ent->fix_scnlen) + pauxent->x_csect.x_scnlen.l = + ((combined_entry_type *) pauxent->x_csect.x_scnlen.p + - obj_raw_syments (abfd)); + + return true; +} + /* Print out information about COFF symbol. */ void -- 2.30.2