annotate src/unexhp9k800.c @ 5450:8c406331e77e

Copyright and license to src/s/sol2.h.
author Mats Lidell <matsl@xemacs.org>
date Thu, 06 Jan 2011 01:31:43 +0100
parents 308d34e9f07d
children 90dcf2376909
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Unexec for HP 9000 Series 800 machines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Bob Desinger <hpsemc!bd@hplabs.hp.com>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 3025
diff changeset
6 XEmacs is free software: you can redistribute it and/or modify it
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 3025
diff changeset
8 Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 3025
diff changeset
9 option) any later version.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 3025
diff changeset
17 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 /* Synched up with: Not synched with FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 Unexec creates a copy of the old a.out file, and replaces the old data
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 area with the current data area. When the new file is executed, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 process will see the same data structures and data values that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 original process had when unexec was called.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 Unlike other versions of unexec, this one copies symbol table and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 debug information to the new a.out file. Thus, the new a.out file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 may be debugged with symbolic debuggers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 If you fix any bugs in this, I'd like to incorporate your fixes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 Send them to uunet!hpda!hpsemc!jmorris or jmorris%hpsemc@hplabs.HP.COM.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 CAVEATS:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 This routine saves the current value of all static and external
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 variables. This means that any data structure that needs to be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 initialized must be explicitly reset. Variables will not have their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 expected default values.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 Unfortunately, the HP-UX signal handler has internal initialization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 flags which are not explicitly reset. Thus, for signals to work in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 conjunction with this routine, the following code must executed when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 the new process starts up.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 void _sigreturn();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 sigsetreturn(_sigreturn);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 #include <config.h>
430
a5df635868b2 Import from CVS: tag r21-2-23
cvs
parents: 428
diff changeset
53 #include <stdlib.h>
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 #include <stdio.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 #include <fcntl.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 #include <errno.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 #include <a.out.h>
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
59 #include "lisp.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 * Minor modification to enable dumping with shared libraries added by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 * Dipankar Gupta (dg@hplb.hpl.hp.com). I studied Oliver Laumann's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 * more elaborate dynamic loading scheme in ELK while implementing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 * this, but don't use any of his machinery.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 * Stores the BRK value at dump time, and uses the RUN_TIME_REMAP hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 * to break back to the stored value when the dumped executable is restarted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 * CAVEATS (addenda):
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 * 1. Text area of the shlibs are not stored. Thus, if a shared library is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 * replaced between the time of dump and execution, all bets are off.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 * 2. Assumes that the data and bss area are adjacent, which is true of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 * current VM implementation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 * 3. Any setup that defines HPUX_USE_SHLIBS *must* also define
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 * RUN_TIME_REMAP.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 #ifdef HPUX_USE_SHLIBS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 #include <dl.h> /* User-space dynamic loader entry points */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
83 static void Save_Shared_Data (void);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
84 static void Restore_Shared_Data (void);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 void write_header(int file, struct header *hdr, struct som_exec_auxhdr *auxhdr);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 void read_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 void save_data_space (int file, struct header *hdr,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 struct som_exec_auxhdr *auxhdr, int size);
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
91 void copy_rest (int old, int new_);
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
92 void copy_file (int old, int new_, int size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 void update_file_ptrs(int file, struct header *hdr,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 struct som_exec_auxhdr *auxhdr,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 unsigned int location, int offset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 int calculate_checksum(struct header *hdr);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 /* Create a new a.out file, same as old but with current data space */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 int
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
100 unexec (char *new_name, /* name of the new a.out file to be created */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
101 char *old_name, /* name of the old a.out file */
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 442
diff changeset
102 uintptr_t UNUSED (new_end_of_text), /* ptr to new edata/etext */
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 442
diff changeset
103 uintptr_t UNUSED (dummy1), /* not used by emacs */
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 442
diff changeset
104 uintptr_t UNUSED (dummy2))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 {
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
106 int old, new_;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 int old_size, new_size;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 struct header hdr;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 struct som_exec_auxhdr auxhdr;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 long i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 /* For the greatest flexibility, should create a temporary file in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 the same directory as the new file. When everything is complete,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 rename the temp file to the new name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 This way, a program could update its own a.out file even while
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 it is still executing. If problems occur, everything is still
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 intact. NOT implemented. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 /* Open the input and output a.out files */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 old = open (old_name, O_RDONLY);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 if (old < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 { perror(old_name); exit(1); }
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
123 new_ = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777);
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
124 if (new_ < 0)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 { perror(new_name); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 /* Read the old headers */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 read_header(old, &hdr, &auxhdr);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 #ifdef HPUX_USE_SHLIBS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 Save_Shared_Data(); /* Save break value (added: dg@hplb.hpl.hp.com) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 /* Decide how large the new and old data areas are */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 old_size = auxhdr.exec_dsize;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 /* I suspect these two statements are separate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 to avoid a compiler bug in hpux version 8. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 i = (long) sbrk (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 new_size = i - auxhdr.exec_dmem;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 /* Copy the old file to the new, up to the data space */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 lseek(old, 0, 0);
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
142 copy_file(old, new_, auxhdr.exec_dfile);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 /* Skip the old data segment and write a new one */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 lseek(old, old_size, 1);
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
146 save_data_space(new_, &hdr, &auxhdr, new_size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 /* Copy the rest of the file */
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
149 copy_rest(old, new_);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 /* Update file pointers since we probably changed size of data area */
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
152 update_file_ptrs(new_, &hdr, &auxhdr, auxhdr.exec_dfile, new_size-old_size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 /* Save the modified header */
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
155 write_header(new_, &hdr, &auxhdr);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 /* Close the binary file */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 close (old);
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
159 close (new_);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 /* Save current data space in the file, update header. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 void
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 442
diff changeset
166 save_data_space (int file, struct header *UNUSED (hdr),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 struct som_exec_auxhdr *auxhdr, int size)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 /* Write the entire data space out to the file */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 if (write(file, (void *)auxhdr->exec_dmem, size) != size)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 { perror("Can't save new data space"); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 /* Update the header to reflect the new data size */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 auxhdr->exec_dsize = size;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 auxhdr->exec_bsize = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 /* Update the values of file pointers when something is inserted. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 update_file_ptrs(int file, struct header *hdr,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 struct som_exec_auxhdr *auxhdr,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 unsigned int location, int offset)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 struct subspace_dictionary_record subspace;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 int i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 /* Increase the overall size of the module */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 hdr->som_length += offset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 /* Update the various file pointers in the header */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 #define update(ptr) if (ptr > location) ptr = ptr + offset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 update(hdr->aux_header_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 update(hdr->space_strings_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 update(hdr->init_array_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 update(hdr->compiler_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 update(hdr->symbol_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 update(hdr->fixup_request_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 update(hdr->symbol_strings_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 update(hdr->unloadable_sp_location);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 update(auxhdr->exec_tfile);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 update(auxhdr->exec_dfile);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 /* Do for each subspace dictionary entry */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 lseek(file, hdr->subspace_location, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 for (i = 0; i < hdr->subspace_total; i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 if (read(file, &subspace, sizeof(subspace)) != sizeof(subspace))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 { perror("Can't read subspace record"); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 /* If subspace has a file location, update it */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 if (subspace.initialization_length > 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 && subspace.file_loc_init_value > location)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 subspace.file_loc_init_value += offset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 lseek(file, -sizeof(subspace), 1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 if (write(file, &subspace, sizeof(subspace)) != sizeof(subspace))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 { perror("Can't update subspace record"); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 /* Do for each initialization pointer record */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 /* (I don't think it applies to executable files, only relocatables) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 #undef update
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 /* Read in the header records from an a.out file. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 read_header(int file, struct header *hdr, struct som_exec_auxhdr *auxhdr)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 /* Read the header in */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 lseek(file, 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 if (read(file, hdr, sizeof(*hdr)) != sizeof(*hdr))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 { perror("Couldn't read header from a.out file"); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 if (hdr->a_magic != EXEC_MAGIC && hdr->a_magic != SHARE_MAGIC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 && hdr->a_magic != DEMAND_MAGIC)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 fprintf(stderr, "a.out file doesn't have legal magic number\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 exit(1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 lseek(file, hdr->aux_header_location, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 if (read(file, auxhdr, sizeof(*auxhdr)) != sizeof(*auxhdr))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 perror("Couldn't read auxiliary header from a.out file");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 exit(1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 /* Write out the header records into an a.out file. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 write_header(int file, struct header *hdr, struct som_exec_auxhdr *auxhdr)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 /* Update the checksum */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 hdr->checksum = calculate_checksum(hdr);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 /* Write the header back into the a.out file */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 lseek(file, 0, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 if (write(file, hdr, sizeof(*hdr)) != sizeof(*hdr))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 { perror("Couldn't write header to a.out file"); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 lseek(file, hdr->aux_header_location, 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 if (write(file, auxhdr, sizeof(*auxhdr)) != sizeof(*auxhdr))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 { perror("Couldn't write auxiliary header to a.out file"); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 /* Calculate the checksum of a SOM header record. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 calculate_checksum(struct header *hdr)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 int checksum, i, *ptr;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 checksum = 0; ptr = (int *) hdr;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 for (i=0; i<sizeof(*hdr)/sizeof(int)-1; i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 checksum ^= ptr[i];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 return(checksum);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 /* Copy size bytes from the old file to the new one. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 void
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
285 copy_file (int old, int new_, int size)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 int len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 int buffer[8192]; /* word aligned will be faster */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 for (; size > 0; size -= len)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
292 len = size < sizeof (buffer) ? size : sizeof (buffer);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
293 if (read (old, buffer, len) != len)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
294 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
295 perror ("Read failure on a.out file");
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
296 exit (1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
297 }
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
298 if (write (new_, buffer, len) != len)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
299 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
300 perror ("Write failure in a.out file");
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
301 exit (1);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
302 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 /* Copy the rest of the file, up to EOF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 void
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
308 copy_rest (int old, int new_)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 int buffer[4096];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 int len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 /* Copy bytes until end of file or error */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 while ( (len = read(old, buffer, sizeof(buffer))) > 0)
3025
facf3239ba30 [xemacs-hg @ 2005-10-25 11:16:19 by ben]
ben
parents: 2286
diff changeset
315 if (write(new_, buffer, len) != len) break;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 if (len != 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 { perror("Unable to copy the rest of the file"); exit(1); }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 #ifdef DEBUG
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 display_header(struct header *hdr, struct som_exec_auxhdr *auxhdr)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 /* Display the header information (debug) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 printf("\n\nFILE HEADER\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 printf("magic number %d \n", hdr->a_magic);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 printf("text loc %.8x size %d \n", auxhdr->exec_tmem, auxhdr->exec_tsize);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 printf("data loc %.8x size %d \n", auxhdr->exec_dmem, auxhdr->exec_dsize);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 printf("entry %x \n", auxhdr->exec_entry);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 printf("Bss segment size %u\n", auxhdr->exec_bsize);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 printf("\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 printf("data file loc %d size %d\n",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 auxhdr->exec_dfile, auxhdr->exec_dsize);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 printf("som_length %d\n", hdr->som_length);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 printf("unloadable sploc %d size %d\n",
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 hdr->unloadable_sp_location, hdr->unloadable_sp_size);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 #endif /* DEBUG */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 #ifdef HPUX_USE_SHLIBS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 /* Added machinery for shared libs... see comments at the beginning of this file. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 void *Brk_On_Dump = 0; /* Brk value to restore... stored as a global */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
345 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
346 Save_Shared_Data (void)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
347 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
348 Brk_On_Dump = sbrk (0);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
351 static void
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
352 Restore_Shared_Data (void)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
353 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
354 brk (Brk_On_Dump);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 /* run_time_remap is the magic called by startup code in the dumped executable
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
358 if RUN_TIME_REMAP is set. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
359 int
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 442
diff changeset
360 run_time_remap (char *UNUSED (dummy))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
361 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
362 Restore_Shared_Data ();
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
363 return 0;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 430
diff changeset
364 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 #endif /* HPUX_USE_SHLIBS */