* peicode.h (coff_swap_aux_in): Swap in extra PE x_scn fields.
authorIan Lance Taylor <ian@airs.com>
Wed, 27 Mar 1996 22:53:16 +0000 (22:53 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 27 Mar 1996 22:53:16 +0000 (22:53 +0000)
(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
bfd/coffgen.c
bfd/coffswap.h
bfd/peicode.h

index 9d63a46be2050480a31b8e5474f7381de607f6af..bdbd3df35740b6dd351576922711a5fdac5c2068 100644 (file)
@@ -1,5 +1,11 @@
 Wed Mar 27 10:43:34 1996  Ian Lance Taylor  <ian@cygnus.com>
 
+       * 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
index 5b45fde824220b8650eb797fc99ff7dc4faebb86..5948189b053aba683ea8a80eb6c7e9adaed9897a 100644 (file)
@@ -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 */
index 44a1702b75ba927eade22e0ee0cab3879d12eee4..10586c0c6d744e774a45b318a56993d0b4ef75f7 100644 (file)
@@ -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;
index 1797e80f9a2ab2db13f1a6038528ea6e6a0383ad..3b8091e623a68d638a3f9496e4238bab1897bd56 100644 (file)
@@ -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;