diff src/unexelf.c @ 247:e70b3a057e12 r20-5b22

Import from CVS: tag r20-5b22
author cvs
date Mon, 13 Aug 2007 10:18:21 +0200
parents 538048ae2ab8
children 677f6a0ee643
line wrap: on
line diff
--- a/src/unexelf.c	Mon Aug 13 10:17:55 2007 +0200
+++ b/src/unexelf.c	Mon Aug 13 10:18:21 2007 +0200
@@ -799,9 +799,17 @@
       /* Write out the sections. .data and .data1 (and data2, called
 	 ".data" in the strings table) get copied from the current process
 	 instead of the old file.  */
+#ifdef __powerpc__
+      /* The PowerPC has additional 'data' segments which need to be saved */
+      if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data") ||
+	  !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data1") ||
+	  !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata") ||
+	  !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata1"))
+#else
       if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data")
 	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
 		      ".data1"))
+#endif
 	src = (caddr_t) OLD_SECTION_H (n).sh_addr;
       else
 	src = old_base + OLD_SECTION_H (n).sh_offset;
@@ -864,9 +872,17 @@
 	   be no harm in that provided that r_offset is always the first
 	   member.  */
 	nn = section.sh_info;
+#ifdef __powerpc__
+      /* The PowerPC has additional 'data' segments which need to be saved */
+	if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data") ||
+	    !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data1") ||
+	    !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata") ||
+	    !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".sdata1"))
+#else
 	if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data")
 	    || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
 			".data1"))
+#endif
 	  {
 	    Elf32_Addr offset = NEW_SECTION_H (nn).sh_addr -
 	      NEW_SECTION_H (nn).sh_offset;