(Duplicate change from p3.)
authorSean Eric Fagan <sef@cygnus>
Wed, 4 Nov 1992 21:57:47 +0000 (21:57 +0000)
committerSean Eric Fagan <sef@cygnus>
Wed, 4 Nov 1992 21:57:47 +0000 (21:57 +0000)
Only change coff auxent header fields when the circumstances require it.  or
at least warrant.

bfd/ChangeLog
bfd/coffcode.h

index d4ffe3e74e0402abada78d15295ddf1119efd2af..c35363dba3af3cde87b743382fbb2a0f0b725c99 100644 (file)
@@ -1,3 +1,10 @@
+Wed Nov  4 13:40:23 1992  Sean Eric Fagan  (sef@cygnus.com)
+
+       * coffcode.h (coff_swap_aux_out, coff_swap_aux_in):  check for
+       symbol type before blindly modifying the auxent.  Specifically,
+       only modify the endndx fields for types that need it, and don't
+       set the array information for non-arrays.
+
 Wed Nov  4 09:30:50 1992  Ken Raeburn  (raeburn@cygnus.com)
 
        * aoutx.h (some_aout_object_p): Section list should be set up
index a3c03b749732bdb3e7e75f199efeb32d54422d6c..4f615ddebc91b406e2eed62c05a06a4c4d16f228 100644 (file)
@@ -650,7 +650,7 @@ DEFUN(coff_swap_aux_in,(abfd, ext1, type, class, in1),
       in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx);
 #endif
 
-      if (ISARY(type) || class == C_BLOCK) {
+      if (ISARY(type)) {
 #if DIMNUM != E_DIMNUM
          -> Error, we need to cope with truncating or extending DIMNUM!;
 #else
@@ -660,8 +660,10 @@ DEFUN(coff_swap_aux_in,(abfd, ext1, type, class, in1),
          in->x_sym.x_fcnary.x_ary.x_dimen[3] = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]);
 #endif
        }
-      in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR(abfd, ext);
-      in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX(abfd, ext);
+      if (class == C_BLOCK || ISFCN(type) || ISTAG(type)) {
+       in->x_sym.x_fcnary.x_fcn.x_lnnoptr = GET_FCN_LNNOPTR(abfd, ext);
+       in->x_sym.x_fcnary.x_fcn.x_endndx.l = GET_FCN_ENDNDX(abfd, ext);
+      }
 
       if (ISFCN(type)) {
          in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize);
@@ -735,14 +737,16 @@ DEFUN(coff_swap_aux_out,(abfd, inp, type, class, extp),
     bfd_h_put_16(abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx);
 #endif
 
-    PUT_FCN_LNNOPTR(abfd,  in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext);
-    PUT_FCN_ENDNDX(abfd,  in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext);
+    if (class == C_BLOCK || ISFCN(type) || ISTAG(type)) {
+      PUT_FCN_LNNOPTR(abfd,  in->x_sym.x_fcnary.x_fcn.x_lnnoptr, ext);
+      PUT_FCN_ENDNDX(abfd,  in->x_sym.x_fcnary.x_fcn.x_endndx.l, ext);
+    }
 
     if (ISFCN(type)) {
       PUTWORD(abfd, in->x_sym.x_misc.x_fsize, (bfd_byte *)  ext->x_sym.x_misc.x_fsize);
     }
     else {
-      if (ISARY(type) || class == C_BLOCK) {
+      if (ISARY(type)) {
 #if DIMNUM != E_DIMNUM
        -> Error, we need to cope with truncating or extending DIMNUM!;
 #else