source: branches/libc-0.6/src/emx/include/sys/omflib.h

Last change on this file was 2001, checked in by bird, 20 years ago

o Added support for new EMX a.out stab N_EXP (0x6c). This encodes export

definitions. (gcc can do declspec(dllexport) now.)
TODO: ld needs updating, probably this is the right time to drop the

old ld and fixup the binutils port!

  • Property cvs2svn:cvs-rev set to 1.7
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 5.0 KB
Line 
1/* sys/omflib.h (emx+gcc) */
2
3/* Public header file for the emx OMFLIB library. */
4
5#ifndef _SYS_OMFLIB_H
6#define _SYS_OMFLIB_H
7
8#if defined (__cplusplus)
9extern "C" {
10#endif
11
12#ifndef _BYTE_WORD_DWORD
13#define _BYTE_WORD_DWORD
14typedef unsigned char byte;
15typedef unsigned short word;
16typedef unsigned long dword;
17#endif /* _BYTE_WORD_DWORD */
18
19#if !defined (THEADR)
20
21/* OMF record types. To get the 32-bit variant of a record type, add
22 REC32. */
23#define THEADR 0x80 /* Translator module header record */
24#define COMENT 0x88 /* Comment record */
25#define MODEND 0x8a /* Module end record */
26#define EXTDEF 0x8c /* External names definition record */
27#define TYPDEF 0x8e /* Type definition record */
28#define PUBDEF 0x90 /* Public names definition record */
29#define LINNUM 0x94 /* Line numbers record */
30#define LNAMES 0x96 /* List of names record */
31#define SEGDEF 0x98 /* Segment definition record */
32#define GRPDEF 0x9a /* Group definition record */
33#define FIXUPP 0x9c /* Fixup record */
34#define LEDATA 0xa0 /* Logical enumerated data record */
35#define LIDATA 0xa2 /* Logical iterated data record */
36#define COMDEF 0xb0 /* Communal names definition record */
37#define COMDEF_TYPEFAR 0x61 /* Commnual name type: far */
38#define COMDEF_TYPENEAR 0x62 /* Commnual name type: near */
39#define COMDAT 0xc2 /* Common block */
40#define ALIAS 0xc6 /* Alias definition record */
41#define LIBHDR 0xf0 /* Library header */
42#define LIBEND 0xf1 /* Library end */
43
44/* Add this constant (using the | operator) to get the 32-bit variant
45 of a record type. Some fields will contain 32-bit values instead
46 of 16-bit values. */
47#define REC32 0x01
48
49#endif
50
51/* Comment classes */
52#define CLASS_TRANS 0x00 /* Translators - who uses this? */
53#define CLASS_INTELC 0x01 /* Intel Copryight */
54#define CLASS_MSDOSVER 0x9c /* MS-DOS version - obsolete */
55#define CLASS_MODEL 0x9d /* Memory model - ignored by linker. */
56#define CLASS_DOSSEG 0x9e /* Linker DOSSEG switch. */
57#define CLASS_DEFLIB 0x9f /* Default library. */
58#define CLASS_OMFEXT 0xa0 /* OMF extenstions */
59#define OMFEXT_IMPDEF 0x01
60#define OMFEXT_EXPDEF 0x02
61#define OMFEXT_INCDEF 0x03
62#define OMFEXT_PROTLIB 0x04
63#define OMFEXT_LNKDIR 0x05
64#define CLASS_DBGTYPE 0xa1 /* Debug type */
65#define CLASS_PASS 0xa2 /* End of linker pass 1. */
66#define CLASS_LIBMOD 0xa3 /* Library module comment. */
67#define CLASS_EXESTR 0xa4 /* Executable Module Identification String. */
68#define CLASS_INCERR 0xa6 /* Incremental compilation error. */
69#define CLASS_NOPAD 0xa7 /* No segment padding. */
70#define CLASS_WKEXT 0xa8 /* Weak external. */
71#define CLASS_LZEXT 0xa9 /* Lazy external. */
72#define CLASS_PHARLAP 0xaa /* PharLap Format record. */
73#define CLASS_IPADATA 0xae /* Interprocedural Analysis Data record. */
74#define CLASS_TIS 0xac /* TIS standard level? 'TIS' + version word. */
75#define CLASS_DBGPACK 0xad /* /DBGPACK DLL name for ilink. */
76#define CLASS_IDMDLL 0xaf /* Identifier Manipulator Dynamic Link Library. */
77
78
79#if !defined (IMPDEF_CLASS)
80#define IMPDEF_CLASS CLASS_OMFEXT
81#define LIBMOD_CLASS 0xa3
82#define IMPDEF_SUBTYPE OMFEXT_IMPDEF
83#endif
84
85struct omflib;
86
87struct omflib *omflib_open (const char *fname, char *error);
88struct omflib *omflib_create (const char *fname, int page_size, char *error);
89int omflib_close (struct omflib *p, char *error);
90int omflib_module_name (char *dst, const char *src);
91int omflib_find_module (struct omflib *p, const char *name, char *error);
92int omflib_mark_deleted (struct omflib *p, const char *name, char *error);
93int omflib_pubdef_walk (struct omflib *p, word page,
94 int (*walker)(const char *name, char *error), char *error);
95int omflib_extract (struct omflib *p, const char *name, char *error);
96int omflib_add_module (struct omflib *p, const char *fname, char *error);
97int omflib_module_count (struct omflib *p, char *error);
98int omflib_module_info (struct omflib *p, int n, char *name, int *page,
99 char *error);
100int omflib_copy_lib (struct omflib *dst, struct omflib *src, char *error);
101int omflib_finish (struct omflib *p, char *error);
102int omflib_write_record (struct omflib *p, byte rec_type, word rec_len,
103 const byte *buffer, int chksum, char *error);
104int omflib_write_module (struct omflib *p, const char *name, word *pagep,
105 char *error);
106int omflib_add_pub (struct omflib *p, const char *name, word page,
107 char *error);
108int omflib_header (struct omflib *p, char *error);
109int omflib_find_symbol (struct omflib *p, const char *name, char *error);
110long omflib_page_pos (struct omflib *p, int page);
111
112#if defined (__cplusplus)
113}
114#endif
115
116#endif /* not _SYS_OMFLIB_H */
Note: See TracBrowser for help on using the repository browser.