# HG changeset patch # User Andreas Schwab # Date 891854780 0 # Node ID 9c3fc93e79572c4bcb84783e131dbb646d896fde # Parent 215a47a9f02bab304ca6cf92560dc2ba589fe719 (unexec): Account for possible padding before the old .bss section. diff -r 215a47a9f02b -r 9c3fc93e7957 src/unexelf.c --- 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? */