home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * AofFile.h
- * Copyright © 1992 Niklas Röjemo
- *
- * Types that exist in an AOF file.
- */
-
- #ifndef AofFile_h
- #define AofFile_h
-
- typedef struct {
- int Name; /* Offset into string table */
- int Type;
- int Size; /* Size of area, must be divisible by four */
- int noRelocations; /* Size of relocation table */
- int Unused; /* Unused, must be zero */
- }AofEntry;
-
- #define AofHeaderID 0xc5e2d080
-
- typedef struct {
- int Type; /* 0xc5e2d080 if relocatable object format */
- int Version; /* 1.xx -> 150 2.xx -> 200 */
- int noAreas; /* size of Area[] */
- int noSymbols; /* size of Symbol Table if such exist */
- int EntryArea; /* Where to start execution, 0 no entry */
- int EntryOffset; /* otherwise start at Area[EntryArea]+AreaOffset */
- AofEntry entry[1];
- } AofHeader;
-
- #define aofHeaderSize(max) \
- (sizeof (AofHeader) + \
- (max - 1) * sizeof(AofEntry))
-
- #define HOW1_INIT 0x00000000
- #define HOW1_BYTE 0x00000000
- #define HOW1_HALF 0x00010000
- #define HOW1_WORD 0x00020000
- #define HOW1_SIZE 0x00030000
-
- #define HOW1_RELATIVE 0x00040000
- #define HOW1_SYMBOL 0x00080000 /* Only used if not HOW1_RELATIVE */
- #define HOW1_SIDMASK 0x0000ffff /* Only used if HOW1_SYMBOL */
-
- #define HOW_TYPE2 0x80000000
- #define HOW2_INIT 0x80000000
- #define HOW2_BYTE 0x00000000
- #define HOW2_HALF 0x01000000
- #define HOW2_WORD 0x02000000
- #define HOW2_SIZE 0x03000000
-
- #define HOW2_RELATIVE 0x04000000
- #define HOW2_SYMBOL 0x08000000 /* Only used if not HOW2_RELATIVE */
- #define HOW2_SIDMASK 0x00ffffff /* Symbol offset if HOW2_SYMBOL, otherwise area number */
-
- typedef struct {
- int Offset; /* Offset in area of the field to be relocated */
- int How; /* How relocation is done */
- } AofReloc;
-
- #define TYPE_LOCAL 0x01 /* Defined with local scope */
- #define TYPE_REFERENCE 0x02
- #define TYPE_GLOBAL 0x03 /* Defined with global scope */
- #define TYPE_KIND 0x03
- #define TYPE_DEFINE 0x01
- #define TYPE_EXPORT 0x02
-
- #define TYPE_ABSOLUTE 0x04 /* This is a constant, (not valid if TYPE_REFERENCE) */
- #define TYPE_NOCASE 0x08 /* Only if TYPE_REFERENCE, case insesitive */
- #define TYPE_WEAK 0x10 /* Only if TYPE_REFERENCE, must not be resolved */
- #define TYPE_STRONG 0x20 /* Complicated ??? */
- #define TYPE_COMMON 0x40
-
- typedef struct {
- int Name; /* Offset in string Table */
- int Type;
- int Value; /* Value if constant, Size if common, otherwise Offset */
- int AreaName;
- } AofSymbol;
-
-
- #endif
-