aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/unexec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/unexec.c b/src/unexec.c
index d91644519f1..2de8b20b588 100644
--- a/src/unexec.c
+++ b/src/unexec.c
@@ -490,6 +490,7 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
490 block_copy_start += sizeof (f_ohdr); 490 block_copy_start += sizeof (f_ohdr);
491 } 491 }
492 /* Loop through section headers, copying them in */ 492 /* Loop through section headers, copying them in */
493 lseek (a_out, sizeof (f_hdr) + f_hdr.f_opthdr, 0);
493 for (scns = f_hdr.f_nscns; scns > 0; scns--) { 494 for (scns = f_hdr.f_nscns; scns > 0; scns--) {
494 if (read (a_out, &scntemp, sizeof (scntemp)) != sizeof (scntemp)) 495 if (read (a_out, &scntemp, sizeof (scntemp)) != sizeof (scntemp))
495 { 496 {
@@ -657,7 +658,9 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
657 * will not adjust the file pointer for that section correctly. 658 * will not adjust the file pointer for that section correctly.
658 */ 659 */
659 660
660 lseek (a_out, sizeof (f_hdr) + sizeof (f_ohdr), 0); 661 /* This used to use sizeof (f_ohdr) instead of .f_opthdr.
662 .f_opthdr is said to be right when there is no optional header. */
663 lseek (a_out, sizeof (f_hdr) + f_hdr.f_opthdr, 0);
661 664
662 for (scns = f_hdr.f_nscns; scns > 0; scns--) 665 for (scns = f_hdr.f_nscns; scns > 0; scns--)
663 { 666 {