Blame SOURCES/emacs-0002-ELF-unexec-Correct-section-header-index.patch

1db854
From acfdfce2687342a119d4fe7cae8f5d04550a9d4a Mon Sep 17 00:00:00 2001
1db854
From: Alan Modra <amodra@gmail.com>
1db854
Date: Sun, 8 Nov 2015 09:28:59 -0800
1db854
Subject: [PATCH 02/11] ELF unexec: Correct section header index
1db854
1db854
First a small fix.  The code incorrectly uses "NEW_SECTION_H (n)" when
1db854
it should have been using "NEW_SECTION_H (nn)" to find the name of the
1db854
section currently being processed.  Of course, before the bss
1db854
sections, n and nn have the same value, so this doesn't matter except
1db854
in the case of .sbss.  For .sbss this probably meant .bss (most likely
1db854
the next section) was copied from memory.  A later patch removes the
1db854
bogus .sbss handling anyway.
1db854
1db854
* unexelf.c (unexec): Use correct index to look up names.
1db854
---
1db854
 src/unexelf.c | 16 ++++++++--------
1db854
 1 file changed, 8 insertions(+), 8 deletions(-)
1db854
1db854
diff --git a/src/unexelf.c b/src/unexelf.c
1db854
index 483da6e..1699f31 100644
1db854
--- a/src/unexelf.c
1db854
+++ b/src/unexelf.c
1db854
@@ -1015,12 +1015,12 @@ temacs:
1db854
       /* Write out the sections. .data and .data1 (and data2, called
1db854
 	 ".data" in the strings table) get copied from the current process
1db854
 	 instead of the old file.  */
1db854
-      if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data")
1db854
-	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1db854
+      if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data")
1db854
+	  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1db854
 		      ".sdata")
1db854
-	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1db854
+	  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1db854
 		      ".lit4")
1db854
-	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1db854
+	  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1db854
 		      ".lit8")
1db854
 	  /* The conditional bit below was in Oliva's original code
1db854
 	     (1999-08-25) and seems to have been dropped by mistake
1db854
@@ -1043,14 +1043,14 @@ temacs:
1db854
 	     loader, but I never got anywhere with an SGI support call
1db854
 	     seeking clues.  -- fx 2002-11-29.  */
1db854
 #ifdef IRIX6_5
1db854
-	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1db854
+	  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1db854
 		      ".got")
1db854
 #endif
1db854
-	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1db854
+	  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1db854
 		      ".sdata1")
1db854
-	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1db854
+	  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1db854
 		      ".data1")
1db854
-	  || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name),
1db854
+	  || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1db854
 		      ".sbss"))
1db854
 	src = (caddr_t) OLD_SECTION_H (n).sh_addr;
1db854
       else
1db854
-- 
1db854
2.7.4
1db854