comparison src/unexelf.c @ 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 027030dd12c4
children bd52f7e0fcdc
comparison
equal deleted inserted replaced
21381:215a47a9f02b 21382:9c3fc93e7957
797 break; 797 break;
798 } 798 }
799 if (n < 0) 799 if (n < 0)
800 fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0); 800 fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0);
801 801
802 NEW_PROGRAM_H (n).p_filesz += new_data2_size; 802 /* Make sure that the size includes any padding before the old .bss
803 section. */
804 NEW_PROGRAM_H (n).p_filesz = new_bss_addr - NEW_PROGRAM_H (n).p_vaddr;
803 NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz; 805 NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz;
804 806
805 #if 0 /* Maybe allow section after data2 - does this ever happen? */ 807 #if 0 /* Maybe allow section after data2 - does this ever happen? */
806 for (n = new_file_h->e_phnum - 1; n >= 0; n--) 808 for (n = new_file_h->e_phnum - 1; n >= 0; n--)
807 { 809 {