diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/unexelf.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/unexelf.c b/src/unexelf.c index 10c3fa51128..79a398228ea 100644 --- a/src/unexelf.c +++ b/src/unexelf.c | |||
| @@ -33,14 +33,14 @@ what you give them. Help stamp out software-hoarding! */ | |||
| 33 | * Modified heavily since then. | 33 | * Modified heavily since then. |
| 34 | * | 34 | * |
| 35 | * Synopsis: | 35 | * Synopsis: |
| 36 | * unexec (new_name, a_name, data_start, bss_start, entry_address) | 36 | * unexec (new_name, old_name, data_start, bss_start, entry_address) |
| 37 | * char *new_name, *a_name; | 37 | * char *new_name, *old_name; |
| 38 | * unsigned data_start, bss_start, entry_address; | 38 | * unsigned data_start, bss_start, entry_address; |
| 39 | * | 39 | * |
| 40 | * Takes a snapshot of the program and makes an a.out format file in the | 40 | * Takes a snapshot of the program and makes an a.out format file in the |
| 41 | * file named by the string argument new_name. | 41 | * file named by the string argument new_name. |
| 42 | * If a_name is non-NULL, the symbol table will be taken from the given file. | 42 | * If old_name is non-NULL, the symbol table will be taken from the given file. |
| 43 | * On some machines, an existing a_name file is required. | 43 | * On some machines, an existing old_name file is required. |
| 44 | * | 44 | * |
| 45 | * The boundaries within the a.out file may be adjusted with the data_start | 45 | * The boundaries within the a.out file may be adjusted with the data_start |
| 46 | * and bss_start arguments. Either or both may be given as 0 for defaults. | 46 | * and bss_start arguments. Either or both may be given as 0 for defaults. |
| @@ -600,7 +600,8 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 600 | if (fstat (old_file, &stat_buf) == -1) | 600 | if (fstat (old_file, &stat_buf) == -1) |
| 601 | fatal ("Can't fstat (%s): errno %d\n", old_name, errno); | 601 | fatal ("Can't fstat (%s): errno %d\n", old_name, errno); |
| 602 | 602 | ||
| 603 | old_base = mmap (0, stat_buf.st_size, PROT_READ, MAP_SHARED, old_file, 0); | 603 | old_base = mmap ((caddr_t) 0, stat_buf.st_size, PROT_READ, MAP_SHARED, |
| 604 | old_file, 0); | ||
| 604 | 605 | ||
| 605 | if (old_base == (caddr_t) -1) | 606 | if (old_base == (caddr_t) -1) |
| 606 | fatal ("Can't mmap (%s): errno %d\n", old_name, errno); | 607 | fatal ("Can't mmap (%s): errno %d\n", old_name, errno); |
| @@ -720,11 +721,11 @@ unexec (new_name, old_name, data_start, bss_start, entry_address) | |||
| 720 | fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno); | 721 | fatal ("Can't ftruncate (%s): errno %d\n", new_name, errno); |
| 721 | 722 | ||
| 722 | #ifdef UNEXEC_USE_MAP_PRIVATE | 723 | #ifdef UNEXEC_USE_MAP_PRIVATE |
| 723 | new_base = mmap (0, new_file_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, | 724 | new_base = mmap ((caddr_t) 0, new_file_size, PROT_READ | PROT_WRITE, |
| 724 | new_file, 0); | 725 | MAP_PRIVATE, new_file, 0); |
| 725 | #else | 726 | #else |
| 726 | new_base = mmap (0, new_file_size, PROT_READ | PROT_WRITE, MAP_SHARED, | 727 | new_base = mmap ((caddr_t) 0, new_file_size, PROT_READ | PROT_WRITE, |
| 727 | new_file, 0); | 728 | MAP_SHARED, new_file, 0); |
| 728 | #endif | 729 | #endif |
| 729 | 730 | ||
| 730 | if (new_base == (caddr_t) -1) | 731 | if (new_base == (caddr_t) -1) |