diff options
author | Andreas Schwab <[email protected]> | 1998-04-06 09:26:20 +0000 |
---|---|---|
committer | Andreas Schwab <[email protected]> | 1998-04-06 09:26:20 +0000 |
commit | c1937d6a5e694e73944380a5f1f96b8cc884a2b1 (patch) | |
tree | 91880c377045581ae16fa8b7eb618f55f8e38290 /src/unexelf.c | |
parent | 8daf7106e6ab8b3eb742fc33b8ce3b0b10e9a639 (diff) |
(unexec): Account for possible padding before the old .bss
section.
Diffstat (limited to 'src/unexelf.c')
-rw-r--r-- | src/unexelf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/unexelf.c b/src/unexelf.c index 799052baf5..341147a576 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -799,7 +799,9 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) 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? */ |