home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Header: /ax/networking:include/sys/exec.h:networking 1.1 $
- * $Source: /ax/networking:include/sys/exec.h: $
- *
- * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
- *
- * $Log: exec.h,v $
- * Revision 1.1 95/01/11 10:19:13 kwelton
- * Initial revision
- *
- * Revision 1.13 88/10/25 22:29:02 brian
- * Definition of MAXSHLIBS moved to sysconf.h
- *
- * Revision 1.12 88/10/25 13:21:14 brian
- * New magic numbers for shared libraries.
- *
- * Revision 1.11 88/09/20 18:34:50 john
- * Changed magic numbers for shared libraries, added as link
- * time stamp.
- *
- * Revision 1.10 88/09/15 18:34:14 abray
- * Amended version part of exec header, so kernel can use a consistent format
- * (new include file sys/version.h)
- *
- * Revision 1.9 88/09/13 11:16:15 john
- * Added RMAGIC magic number to deal with references to shared libraries.
- *
- * Revision 1.8 88/08/25 02:51:26 keith
- * Define exec_header to be the extended header that exists on the front
- * of all types of file the kernel understands. For compatibility leave
- * "struct exec" as it always has been.
- *
- * Revision 1.7 88/08/24 12:02:46 keith
- * Reverting to the original struct exec; with the additions
- * in a new structure. This is a) to reduce space on disc within
- * things like libraries which dont need the information, and
- * b) because the bootstrapping problems encountered with changing
- * the format were daunting.
- *
- * Revision 1.6 88/08/19 10:46:45 keith
- * Corret spelling of (as yet unused) SPZMAGIC a_magic type.
- * Re-order fields (no users yet) of a_spare -> a_verstime.
- *
- * Revision 1.5 88/08/18 15:05:29 keith
- * Include <sys/types.h> to stop things that include this file complaining
- *
- * Revision 1.4 88/08/11 09:23:57 keith
- * exec struct extended to provide support for QMAGIC squeezed images
- * and (future) shared libraries.
- * A version string can also be inserted in the header.
- *
- * Revision 1.3 88/06/17 20:19:09 beta
- * Acorn Unix initial beta version
- *
- */
- /* @(#)exec.h 1.2 87/05/15 3.2/4.3NFSSRC */
- /*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- * @(#)exec.h 7.1 (Berkeley) 6/4/86
- */
-
- /*
- * Header prepended to each a.out file.
- * For compatibility reasons this structure is called "exec"
- * although an extended structure is actually prepended to all files
- * that are actually executable. The (old) "exec" header is only
- * now used on .o (i.e. type OMAGIC) files produced by compilers,
- * and not on any file that has been completely ld'd.
- */
-
- struct exec {
- long a_magic; /* magic number */
- unsigned long a_text; /* size of text segment */
- unsigned long a_data; /* size of initialized data */
- unsigned long a_bss; /* size of uninitialized data */
- unsigned long a_syms; /* size of symbol table */
- unsigned long a_entry; /* entry point */
- #define a_sldatabase a_entry /* used as data address for shared libs */
- unsigned long a_trsize; /* size of text relocation */
- unsigned long a_drsize; /* size of data relocation */
- };
-
- #ifdef KERNEL
- #include "../h/types.h"
- #include "../h/version.h"
- #else
- #include <sys/types.h>
- #include <sys/version.h>
- #endif KERNEL
-
-
- #define SHLIBLEN 60
-
- /* This is the structure that is actually prepended to all files that
- * the kernel can execute. It contains slots for the extra information
- * required to support shared libraries and/or squeezed images.
- */
- struct exec_header {
- struct exec a_exec; /* The (old) small header */
- struct version a_version; /* Version number time and text */
- unsigned long a_sq4items; /* number of squeezed type 4 items */
- unsigned long a_sq3items; /* number of squeezed type 3 items */
- unsigned long a_sq4size; /* size of squeezed type 4 items */
- unsigned long a_sq3size; /* size of squeezed type 3 items */
- unsigned long a_sq4last; /* last entry in type 4 table (check only) */
- unsigned long a_sq3last; /* last entry in type 3 table (check only) */
- time_t a_timestamp; /* link time of this object */
- time_t a_shlibtime; /* timestamp of shared library */
- char a_shlibname[SHLIBLEN]; /* Path name of shared library */
- };
-
-
- /*
- * Structure used for recording details of a shared library.
- */
-
- struct shlib_info
- {
- struct vnode *si_vp; /* Vnode of file containing shared lib */
- struct exec_header si_eh; /* Exec header from the file */
- int si_xoffset;/* Offset (pages) of text in text segment */
- };
-
-
- /* Basic magic numbers */
-
- #define OMAGIC 0407 /* old impure format */
- #define NMAGIC 0410 /* read-only text */
- #define ZMAGIC 0413 /* demand load format (pure sharable text) */
-
- /* Magic flags - all combinations are valid */
-
- #define MF_IMPURE 00200 /* impure text */
- #define MF_SQUEEZED 01000 /* text and data squeezed */
- #define MF_USES_SL 02000 /* this object uses a shared library */
- #define MF_IS_SL 04000 /* this object is a shared library */
-
- /* Names for some common magic number/flag combinations */
-
- #define IMAGIC (MF_IMPURE|ZMAGIC) /* demand load format (impure text) */
-
- #define SPOMAGIC (MF_USES_SL|OMAGIC) /* OMAGIC with a large header - may */
- /* contain a reference to a shared */
- /* library required by the object. */
-
- #define SLOMAGIC (MF_IS_SL|OMAGIC) /* a reference to a shared library. */
- /* The text portion of the object */
- /* contains ``overflow text'' from */
- /* the shared library to be linked */
- /* in with an object. */
-
- #define QMAGIC (MF_SQUEEZED|ZMAGIC) /* squeezed demand paged */
- #define SPZMAGIC (MF_USES_SL|ZMAGIC) /* program which uses shared lib */
- #define SPQMAGIC (MF_USES_SL|QMAGIC) /* squeezed ditto */
- #define SLZMAGIC (MF_IS_SL|ZMAGIC) /* shared library part of program */
- #define SLPZMAGIC (MF_USES_SL|SLZMAGIC) /* shared lib which uses another */
-
- /* Squeezed shared libraries are not supported (and probably not worth the */
- /* trouble they would cause). */
-
-
- /* Macros for finding properties of magic numbers */
-
- #define IS_SQUEEZED(magic) (((magic) & MF_SQUEEZED) != 0)
- #define IS_SHARED_LIB(magic) (((magic) & MF_IS_SL) != 0)
-
- /* EOF exec.h */
-