changeset 21382:9c3fc93e7957

(unexec): Account for possible padding before the old .bss section.
author Andreas Schwab <schwab@suse.de>
date Mon, 06 Apr 1998 09:26:20 +0000
parents 215a47a9f02b
children aa16b532cf4c
files src/unexelf.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/unexelf.c	Mon Apr 06 09:20:04 1998 +0000
+++ b/src/unexelf.c	Mon Apr 06 09:26:20 1998 +0000
@@ -799,7 +799,9 @@
   if (n < 0)
     fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0);
 
-  NEW_PROGRAM_H (n).p_filesz += new_data2_size;
+  /* Make sure that the size includes any padding before the old .bss
+     section.  */
+  NEW_PROGRAM_H (n).p_filesz = new_bss_addr - NEW_PROGRAM_H (n).p_vaddr;
   NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz;
 
 #if 0 /* Maybe allow section after data2 - does this ever happen? */