From 8230f31c92c3dc4c12a9b6531e50c82284455f95 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 27 Mar 1996 22:53:16 +0000 Subject: [PATCH] * peicode.h (coff_swap_aux_in): Swap in extra PE x_scn fields. (coff_swap_aux_out): Swap out extra PE x_scn fields. * coffswap.h (coff_swap_aux_in): Zero out extra PE x_scn fields. * coffgen.c (coff_print_symbol): If any of the extra PE x_scn fields is non-zero, print them. --- bfd/ChangeLog | 6 ++++++ bfd/coffgen.c | 14 ++++++++++++++ bfd/coffswap.h | 7 +++++++ bfd/peicode.h | 12 ++++++++++++ 4 files changed, 39 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9d63a46..bdbd3df 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ Wed Mar 27 10:43:34 1996 Ian Lance Taylor + * peicode.h (coff_swap_aux_in): Swap in extra PE x_scn fields. + (coff_swap_aux_out): Swap out extra PE x_scn fields. + * coffswap.h (coff_swap_aux_in): Zero out extra PE x_scn fields. + * coffgen.c (coff_print_symbol): If any of the extra PE x_scn + fields is non-zero, print them. + * coff-ppc.c (ppc_record_toc_entry): Put inside COFF_IMAGE_WITH_PE ifdef. Remove unused variables. (ppc_record_data_in_toc_entry): Ifdef out. Removed unused diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 5b45fde..5948189 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1272,6 +1272,11 @@ coff_get_lineno (ignore_abfd, symbol) return coffsymbol (symbol)->lineno; } +#if 0 + +/* This is only called from coff_add_missing_symbols, which has been + disabled. */ + asymbol * coff_section_symbol (abfd, name) bfd *abfd; @@ -1318,6 +1323,8 @@ coff_section_symbol (abfd, name) return sym; } +#endif /* 0 */ + /* This function transforms the offsets into the symbol table into pointers to syments. */ @@ -1866,6 +1873,13 @@ coff_print_symbol (abfd, filep, symbol, how) (long) auxp->u.auxent.x_scn.x_scnlen, auxp->u.auxent.x_scn.x_nreloc, auxp->u.auxent.x_scn.x_nlinno); + if (auxp->u.auxent.x_scn.x_checksum != 0 + || auxp->u.auxent.x_scn.x_associated != 0 + || auxp->u.auxent.x_scn.x_comdat != 0) + fprintf (file, "checksum 0x%lx assoc %d comdat %d", + auxp->u.auxent.x_scn.x_checksum, + auxp->u.auxent.x_scn.x_associated, + auxp->u.auxent.x_scn.x_comdat); break; } /* else fall through */ diff --git a/bfd/coffswap.h b/bfd/coffswap.h index 44a1702..10586c0 100644 --- a/bfd/coffswap.h +++ b/bfd/coffswap.h @@ -397,6 +397,13 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) in->x_scn.x_scnlen = GET_SCN_SCNLEN(abfd, ext); in->x_scn.x_nreloc = GET_SCN_NRELOC(abfd, ext); in->x_scn.x_nlinno = GET_SCN_NLINNO(abfd, ext); + + /* PE defines some extra fields; we zero them out for + safety. */ + in->x_scn.x_checksum = 0; + in->x_scn.x_associated = 0; + in->x_scn.x_comdat = 0; + return; } break; diff --git a/bfd/peicode.h b/bfd/peicode.h index 1797e80..3b8091e 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -535,6 +535,12 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) in->x_scn.x_scnlen = GET_SCN_SCNLEN(abfd, ext); in->x_scn.x_nreloc = GET_SCN_NRELOC(abfd, ext); in->x_scn.x_nlinno = GET_SCN_NLINNO(abfd, ext); + in->x_scn.x_checksum = bfd_h_get_32 (abfd, + (bfd_byte *) ext->x_scn.x_checksum); + in->x_scn.x_associated = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_scn.x_associated); + in->x_scn.x_comdat = bfd_h_get_8 (abfd, + (bfd_byte *) ext->x_scn.x_comdat); return; } break; @@ -615,6 +621,12 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) PUT_SCN_SCNLEN(abfd, in->x_scn.x_scnlen, ext); PUT_SCN_NRELOC(abfd, in->x_scn.x_nreloc, ext); PUT_SCN_NLINNO(abfd, in->x_scn.x_nlinno, ext); + bfd_h_put_32 (abfd, in->x_scn.x_checksum, + (bfd_byte *) ext->x_scn.x_checksum); + bfd_h_put_16 (abfd, in->x_scn.x_associated, + (bfd_byte *) ext->x_scn.x_associated); + bfd_h_put_8 (abfd, in->x_scn.x_comdat, + (bfd_byte *) ext->x_scn.x_comdat); return sizeof (AUXENT); } break; -- 2.7.4