]> code.delx.au - gnu-emacs/commitdiff
(unexec): Round up section header offset to bss alignment
authorRichard M. Stallman <rms@gnu.org>
Mon, 24 Jun 1996 19:54:38 +0000 (19:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 24 Jun 1996 19:54:38 +0000 (19:54 +0000)
before deciding whether it's after the bss section.

src/unexelf.c

index a63ecf0dbb67ac4cde1dd4c97ab10479694120c6..60e82cc6a95f1bf39c41bb0af6ed3a13a588f74f 100644 (file)
@@ -767,7 +767,9 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
              >= OLD_SECTION_H (old_bss_index-1).sh_offset)
            NEW_SECTION_H (nn).sh_offset += new_data2_size;
 #else
-         if (NEW_SECTION_H (nn).sh_offset >= new_data2_offset)
+         if (round_up (NEW_SECTION_H (nn).sh_offset,
+                       OLD_SECTION_H (old_bss_index).sh_addralign)
+             >= new_data2_offset)
            NEW_SECTION_H (nn).sh_offset += new_data2_size;
 #endif
          /* Any section that was originally placed after the section