7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #pragma ident "%Z%%M% %I% %E% SMI"
28
29 #include <stdlib.h>
30 #include <fcntl.h>
31 #include <strings.h>
32 #include <stdio.h>
33 #include <errno.h>
34 #include <sys/types.h>
35 #include <sys/inttypes.h>
36 #include <sys/elf.h>
37 #include <sys/elf_notes.h>
38 #include <sys/mman.h>
39 #include <sys/stat.h>
40 #include <sys/statvfs.h>
41
42 static char *pname;
43 static char *fname;
44 static char *image; /* pointer to the ELF file in memory */
45
46 #define ELFSEEK(offset) ((void *)(image + offset))
47
48 /*
|
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright (c) 2018, Joyent, Inc.
29 */
30
31 #include <unistd.h>
32 #include <stdlib.h>
33 #include <fcntl.h>
34 #include <strings.h>
35 #include <stdio.h>
36 #include <errno.h>
37 #include <sys/types.h>
38 #include <sys/inttypes.h>
39 #include <sys/elf.h>
40 #include <sys/elf_notes.h>
41 #include <sys/mman.h>
42 #include <sys/stat.h>
43 #include <sys/statvfs.h>
44
45 static char *pname;
46 static char *fname;
47 static char *image; /* pointer to the ELF file in memory */
48
49 #define ELFSEEK(offset) ((void *)(image + offset))
50
51 /*
|