aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Modra2015-11-08 09:28:59 -0800
committerPaul Eggert2015-11-08 10:00:59 -0800
commit0bcd08ef052bca9b8d08696068c2a0c387d0dd56 (patch)
tree5fc6f44375e378ae2ff8d97d4012ad9f61d80120 /src
parent82c1b368a227ca710e3582be311f2cbabc33499f (diff)
downloademacs-0bcd08ef052bca9b8d08696068c2a0c387d0dd56.tar.gz
emacs-0bcd08ef052bca9b8d08696068c2a0c387d0dd56.zip
ELF unexec: Correct section header index
First a small fix. The code incorrectly uses "NEW_SECTION_H (n)" when it should have been using "NEW_SECTION_H (nn)" to find the name of the section currently being processed. Of course, before the bss sections, n and nn have the same value, so this doesn't matter except in the case of .sbss. For .sbss this probably meant .bss (most likely the next section) was copied from memory. A later patch removes the bogus .sbss handling anyway. * unexelf.c (unexec): Use correct index to look up names.
Diffstat (limited to 'src')
-rw-r--r--src/unexelf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/unexelf.c b/src/unexelf.c
index 483da6eef0c..1699f310263 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1015,12 +1015,12 @@ temacs:
1015 /* Write out the sections. .data and .data1 (and data2, called 1015 /* Write out the sections. .data and .data1 (and data2, called
1016 ".data" in the strings table) get copied from the current process 1016 ".data" in the strings table) get copied from the current process
1017 instead of the old file. */ 1017 instead of the old file. */
1018 if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data") 1018 if (!strcmp (old_section_names + NEW_SECTION_H (nn).sh_name, ".data")
1019 || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), 1019 || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1020 ".sdata") 1020 ".sdata")
1021 || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), 1021 || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1022 ".lit4") 1022 ".lit4")
1023 || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), 1023 || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1024 ".lit8") 1024 ".lit8")
1025 /* The conditional bit below was in Oliva's original code 1025 /* The conditional bit below was in Oliva's original code
1026 (1999-08-25) and seems to have been dropped by mistake 1026 (1999-08-25) and seems to have been dropped by mistake
@@ -1043,14 +1043,14 @@ temacs:
1043 loader, but I never got anywhere with an SGI support call 1043 loader, but I never got anywhere with an SGI support call
1044 seeking clues. -- fx 2002-11-29. */ 1044 seeking clues. -- fx 2002-11-29. */
1045#ifdef IRIX6_5 1045#ifdef IRIX6_5
1046 || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), 1046 || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1047 ".got") 1047 ".got")
1048#endif 1048#endif
1049 || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), 1049 || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1050 ".sdata1") 1050 ".sdata1")
1051 || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), 1051 || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1052 ".data1") 1052 ".data1")
1053 || !strcmp ((old_section_names + NEW_SECTION_H (n).sh_name), 1053 || !strcmp ((old_section_names + NEW_SECTION_H (nn).sh_name),
1054 ".sbss")) 1054 ".sbss"))
1055 src = (caddr_t) OLD_SECTION_H (n).sh_addr; 1055 src = (caddr_t) OLD_SECTION_H (n).sh_addr;
1056 else 1056 else