diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-04-16 17:46:54 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-04-16 17:46:54 +0000 |
commit | a2d914e15e2bbc5e29a7deab1b6dab999556f0e3 (patch) | |
tree | bbd81047cba3a545729cc4995ab7a7f24aac90a2 /bfd | |
parent | b90f590cfdecf5f63024a738d919ad3ea2f37a1a (diff) | |
download | gdb-a2d914e15e2bbc5e29a7deab1b6dab999556f0e3.zip gdb-a2d914e15e2bbc5e29a7deab1b6dab999556f0e3.tar.gz gdb-a2d914e15e2bbc5e29a7deab1b6dab999556f0e3.tar.bz2 |
* 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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/coffgen.c | 72 |
2 files changed, 80 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e597bde..029d3ea 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +Tue Apr 16 13:44:08 1996 Ian Lance Taylor <ian@cygnus.com> + + * 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 <ian@cygnus.com> * elf32-mips.c (struct mips_hi16): Define. diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 14df3a3..9340fed 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 |