diff options
| author | Richard M. Stallman | 1994-06-16 23:45:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-06-16 23:45:41 +0000 |
| commit | dcceb381ab25d112997e5e4bdd10993dfe5f42ea (patch) | |
| tree | 01ff06cd555034db8426e3437471bd9afb3b7bee /src | |
| parent | ebfbbbe463c0984204346c80737c95ce20dbaad3 (diff) | |
| download | emacs-dcceb381ab25d112997e5e4bdd10993dfe5f42ea.tar.gz emacs-dcceb381ab25d112997e5e4bdd10993dfe5f42ea.zip | |
(make_hdr): Handle case of no "additional header".
Diffstat (limited to 'src')
| -rw-r--r-- | src/unexec.c | 5 |
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 | { |