aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhillip Rulon1999-10-08 23:08:28 +0000
committerPhillip Rulon1999-10-08 23:08:28 +0000
commitf1aba5123374f06e8670874cf3e1d5400025b508 (patch)
tree81c7fcdcc2925ed8b8447ed74116197dff87a18d /src
parentb02b54a8ba4e958fd103c0ae15874b3010c07860 (diff)
downloademacs-f1aba5123374f06e8670874cf3e1d5400025b508.tar.gz
emacs-f1aba5123374f06e8670874cf3e1d5400025b508.zip
(unexec): Don't get confused by a short section
just before the bss section.
Diffstat (limited to 'src')
-rw-r--r--src/unexelf.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/unexelf.c b/src/unexelf.c
index 7fa8eb00ce0..015522638f4 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -926,9 +926,15 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
926 >= OLD_SECTION_H (old_bss_index-1).sh_offset) 926 >= OLD_SECTION_H (old_bss_index-1).sh_offset)
927 NEW_SECTION_H (nn).sh_offset += new_data2_size; 927 NEW_SECTION_H (nn).sh_offset += new_data2_size;
928#else 928#else
929 if (round_up (NEW_SECTION_H (nn).sh_offset, 929 /* The idea of this is that the bss section's sh_offset
930 may need rounding up to compare with new_data2_offset.
931 So we cannot simply compare the sh_offset.
932 However, another small section could exist just before
933 the bss section, and we need to know that is before. */
934 if (round_up (NEW_SECTION_H (nn).sh_offset
935 + NEW_SECTION_H (nn).sh_size,
930 OLD_SECTION_H (old_bss_index).sh_addralign) 936 OLD_SECTION_H (old_bss_index).sh_addralign)
931 >= new_data2_offset) 937 > new_data2_offset)
932 NEW_SECTION_H (nn).sh_offset += new_data2_size; 938 NEW_SECTION_H (nn).sh_offset += new_data2_size;
933#endif 939#endif
934 /* Any section that was originally placed after the section 940 /* Any section that was originally placed after the section