This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch for nlmcode.h to show the copyright tag on >=NW4.x


Hi all!

There's a problem in bfd/nlmcode.h with the order of the auxiliary header
tags, which caused the NW4.x and NW5.x NLM loaders not to show the
copyright string. Not a serious bug, but annoying... :)

Greets,
Keresztg

--
+ Keresztfalvi Gabor
+ Student of the Budapest University of Technology and Economics
+ mailto: keresztg@mail.com  kg230@hszk.bme.hu
+ http://keresztg.ini.hu/

---
2000-11-19  Gabor Keresztfalvi  <keresztg@mail.com>

	* nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of
	the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to
	show the Copyright string.

Index: nlmcode.h
===================================================================
RCS file: /cvs/src/src/bfd/nlmcode.h,v
retrieving revision 1.2
diff -u -p -r1.2 nlmcode.h
--- nlmcode.h	1999/07/12 10:29:54	1.2
+++ nlmcode.h	2000/11/19 10:44:59
@@ -722,6 +722,32 @@ nlm_swap_auxiliary_headers_out (abfd)
 	return false;
     }

+  /* Swapped the order of the MeSsAgEs and CoPyRiGhT tag to make happy the
+     NW4.x and NW5.x loaders. Still works on NW3.x. Thanks for
+     Rostislav Letos from Novell and Gunter Knauf for hints and testing. */
+  /* Write out the copyright header if there is one.  */
+  if (find_nonzero ((PTR) nlm_copyright_header (abfd),
+		    sizeof (Nlm_Internal_Copyright_Header)))
+    {
+      Nlm_External_Copyright_Header thdr;
+
+      memcpy (thdr.stamp, "CoPyRiGhT=", 10);
+      if (bfd_write ((PTR) thdr.stamp, sizeof (thdr.stamp), 1, abfd)
+	  != sizeof (thdr.stamp))
+	return false;
+      thdr.copyrightMessageLength[0] =
+	nlm_copyright_header (abfd)->copyrightMessageLength;
+      if (bfd_write ((PTR) thdr.copyrightMessageLength, 1, 1, abfd) != 1)
+	return false;
+      /* The copyright message is a variable length string. */
+      if (bfd_write ((PTR) nlm_copyright_header (abfd)->copyrightMessage,
+		     nlm_copyright_header (abfd)->copyrightMessageLength + 1,
+		     1, abfd) !=
+	  ((bfd_size_type)
+	   nlm_copyright_header (abfd)->copyrightMessageLength + 1))
+	return false;
+    }
+
   /* Write out the extended header if there is one.  */
   if (find_nonzero ((PTR) nlm_extended_header (abfd),
 		    sizeof (Nlm_Internal_Extended_Header)))
@@ -820,29 +846,6 @@ nlm_swap_auxiliary_headers_out (abfd)
 	return false;
     }

-
-  /* Write out the copyright header if there is one.  */
-  if (find_nonzero ((PTR) nlm_copyright_header (abfd),
-		    sizeof (Nlm_Internal_Copyright_Header)))
-    {
-      Nlm_External_Copyright_Header thdr;
-
-      memcpy (thdr.stamp, "CoPyRiGhT=", 10);
-      if (bfd_write ((PTR) thdr.stamp, sizeof (thdr.stamp), 1, abfd)
-	  != sizeof (thdr.stamp))
-	return false;
-      thdr.copyrightMessageLength[0] =
-	nlm_copyright_header (abfd)->copyrightMessageLength;
-      if (bfd_write ((PTR) thdr.copyrightMessageLength, 1, 1, abfd) != 1)
-	return false;
-      /* The copyright message is a variable length string. */
-      if (bfd_write ((PTR) nlm_copyright_header (abfd)->copyrightMessage,
-		     nlm_copyright_header (abfd)->copyrightMessageLength + 1,
-		     1, abfd) !=
-	  ((bfd_size_type)
-	   nlm_copyright_header (abfd)->copyrightMessageLength + 1))
-	return false;
-    }

   /* Write out the custom header if there is one.   */
   if (find_nonzero ((PTR) nlm_custom_header (abfd),


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]