Changeset 236
- Timestamp:
- May 26, 2003, 4:43:12 PM (22 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 6 added
- 9 deleted
- 376 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/Makefile
-
Property cvs2svn:cvs-rev
changed from
1.15
to1.16
r235 r236 47 47 48 48 # The C compiler 49 CC = gcc -c 49 CC = gcc -c -Zmt 50 50 # The C compiler flags 51 51 CFLAGS.INC = -Iinclude -Isrc/include 52 CFLAGS = -Wall -mstack-arg-probe -Zmt$(CFLAGS.INC) $(CFLAGS.$(MODE)) $(CFLAGS.KIND)52 CFLAGS = -Wall -mstack-arg-probe $(CFLAGS.INC) $(CFLAGS.$(MODE)) $(CFLAGS.KIND) 53 53 # The additional C compiler flags for different build modes 54 54 CFLAGS.opt = -s -O3 55 CFLAGS.dbg = -g 55 CFLAGS.dbg = -g -DDEBUG 56 56 CFLAGS.aout = 57 57 CFLAGS.omf = -Zomf … … 65 65 66 66 # The linker 67 LD = gcc 67 LD = gcc -Zmt 68 68 # Linker flags 69 LDFLAGS = -Zmt$(LDFLAGS.$(MODE)) $(LDFLAGS.KIND)69 LDFLAGS = $(LDFLAGS.$(MODE)) $(LDFLAGS.KIND) 70 70 LDFLAGS.DLL = $(LDFLAGS) -Zdll 71 71 # Linker flags for different build modes … … 126 126 MAKEDEPFLAGS = $(CFLAGS.INC) 127 127 DO.DEPS = $(MAKEDEP) $(MAKEDEPFLAGS) \ 128 -I$(subst $(SPACE), -I,$(sort $(dir $^))) - p$(@D)/ -c -S -f$@ $^128 -I$(subst $(SPACE), -I,$(sort $(dir $^))) -I$. -p$(@D)/ -c -S -f$@ $^ 129 129 130 130 # How to convert an a.out file to the OMF format … … 166 166 # Miscelaneous tools 167 167 MKDIR = mkdir.exe -p $1 168 # How to update a file only if it has been changed 169 UPDATE = (cmp -s $1 $2 || mv -f $1 $2) && rm -f $1 170 # How to touch a file 171 TOUCH = touch $1 168 172 # Re-build the original string including the ',' between args. Also escape 169 173 # dollars since otherwise ash would expand them. … … 186 190 DO.HELP.VARS := $(call ECHO, MODE={dbg|opt} - choose between debug and optimized build modes.)$(NL) 187 191 DO.HELP.VARS += $(call ECHO, OBJF={omf|aout} - build object files in omf or a.out format.)$(NL) 188 # The commands to install everything we have built189 DO.INSTALL :=190 # The list of install directories191 INSDIRS :=192 192 # The list of work directories needeed for building all targets 193 193 TARGDIRS := … … 196 196 # The list of dependency files 197 197 TARGDEPEND := 198 199 .PHONY: default help all tools clean install cleandep cleandepend dep depend depdone 198 # The list of installed files 199 INS.FILES := 200 201 .PHONY: default help all libs tools clean install install cleandep \ 202 cleandepend dep depend depdone 200 203 .SUFFIXES: 201 204 .SUFFIXES: .c .cpp .asm .s .o .exe .dll .a .lib .obj … … 210 213 -include $(SUBMAK) 211 214 212 # Sort and remove duplicate installdirectories215 # Sort and remove duplicate directories 213 216 TARGDIRS := $(sort $(TARGDIRS)) 214 INSDIRS := $(sort $(INSDIRS)) 217 # Find out which directories are needed for installation 218 INSDIRS := $(sort $(dir $(INS.FILES))) 215 219 216 220 #------------ Global targets ------------ … … 223 227 @$(call ECHO, {module-name} - build just a particular module) 224 228 @$(call ECHO, tools - build just the tools) 229 @$(call ECHO, libs - build all libraries) 225 230 @$(call ECHO, clean - remove all generated files (remove all built files)) 226 231 @$(call ECHO, install - generate a installation tree in $(INS)) … … 250 255 @$(call ECHO,Dependency files succesfully updated) 251 256 252 install: all $(INSDIRS) 253 $(DO.INSTALL) 257 install: all $(INSDIRS) $(INS.FILES) 254 258 255 259 $. $(INSDIRS) $(TARGDIRS): -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/common.smak
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r235 r236 37 37 38 38 ifdef .INSDIR 39 DO.INSTALL += $(call CP,$.$(.TARG),$(INS)$(.INSDIR)$(.TARGET))$(NL) 40 INSDIRS += $(INS)$(.INSDIR) 39 INS.FILES += $(INS)$(.INSDIR)$(.TARGET) 40 $(INS)$(.INSDIR)$(.TARGET): $.$(.TARG) 41 $(call CP,$<,$@) 41 42 endif # def .INSDIR 42 43 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/a_out.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 138 138 /* emx */ 139 139 #define N_IMP1 0x68 /* Import definition symbol */ 140 #define N_IMP2 0x6a /* Import definition symbol */ 140 141 141 142 … … 168 169 unsigned int r_pad:4; 169 170 }; 171 170 172 #endif /* __A_OUT_GNU_H__ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/asm386.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 2 2 3 3 #include <sys/errno.h> 4 5 /* Macros for defining standard libc functions */ 6 7 #define _STD(x) __std_ ## x 4 8 5 9 #define _xam fxam; fstsw %ax; andb $0x45, %ah … … 14 18 #if defined (LONG_DOUBLE) 15 19 #define FLD fldt 16 #define MATHSUFFIX1(X) _##X##l17 #define MATHSUFFIX2(X) _ ##X##l18 #define MATHSUFFIX3(X) X##l20 #define MATHSUFFIX1(X) _STD(##X##l) 21 #define MATHSUFFIX2(X) _STD(##X##l) 22 #define MATHSUFFIX3(X) _##X##l 19 23 #define CONV(X) 20 24 #elif defined (FLOAT) 21 25 #define FLD flds 22 #define MATHSUFFIX1(X) _ ##X##f23 #define MATHSUFFIX2(X) _ ##X##f24 #define MATHSUFFIX3(X) X##f26 #define MATHSUFFIX1(X) _STD(##X##f) 27 #define MATHSUFFIX2(X) _STD(##X##f) 28 #define MATHSUFFIX3(X) _##X##f 25 29 #define CONV(X) fstps X; flds X 26 30 #else 27 31 #define FLD fldl 28 #define MATHSUFFIX1(X) X29 #define MATHSUFFIX2(X) _ ##X30 #define MATHSUFFIX3(X) X32 #define MATHSUFFIX1(X) _STD(X) 33 #define MATHSUFFIX2(X) _STD(X) 34 #define MATHSUFFIX3(X) _##X 31 35 #define CONV(X) fstpl X; fldl X 32 36 #endif 33 37 34 #define LABEL0(name) _##name35 #define LABEL(name) LABEL0(name)36 37 38 #define ALIGN .align 2, 0x90 38 39 #if !defined (__MT__)40 41 #define SET_ERRNO_CONST(x) \42 movl x, _errno43 44 #else45 39 46 40 #define SET_ERRNO_CONST(x) \ 47 41 call __errno ;\ 48 42 movl x, (%eax) 49 50 #endif51 43 52 44 #if defined (__GPROF__) … … 73 65 #define FP_INFINITE 3 74 66 #define FP_NAN 4 75 76 /* Macros for defining standard libc functions */77 78 #define CONCAT(x,y) x ## y79 #define _STD(x) CONCAT(__std_,x) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/io.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 165 165 extern struct fdvec _fdvec_head; 166 166 167 #if defined (__MT__)168 169 167 /* This is currently used only in the multi-thread libraries. We 170 168 can't use and reallocate a single array because rmutex semaphores … … 207 205 208 206 #endif /* defined (_SYS_RMUTEX_H) */ 209 210 #else /* !defined (__MT__) */211 212 #define STREAMV_LOCK (void)0213 #define STREAMV_UNLOCK (void)0214 215 #define STREAM_LOCK(f) (void)0216 #define STREAM_UNLOCK(f) (void)0217 #define STREAM_LOCK_NOWAIT(f) 1218 #define STREAM_UNLOCKED(f) 1219 220 #endif /* !defined (__MT__) */221 207 222 208 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/startup.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 8 8 #endif 9 9 10 extern int _CRT_init (void); 11 extern void _CRT_term (void); 12 10 13 /* argv[i][-1] contains some flag bits: */ 11 14 … … 16 19 #define _ARG_NONZERO 0x80 /* Always set, to avoid end of string */ 17 20 18 /* Arrange that FUN will be called by _ startup(). */21 /* Arrange that FUN will be called by _CRT_init(). */ 19 22 20 23 #define _CRT_INIT1(fun) __asm__ (".stabs \"___crtinit1__\", 23, 0, 0, _" #fun); 21 24 22 /* Arrange that FUN will be called by _ cleanup(). */25 /* Arrange that FUN will be called by _CRT_term(). */ 23 26 24 27 #define _CRT_EXIT1(fun) __asm__ (".stabs \"___crtexit1__\", 23, 0, 0, _" #fun); … … 29 32 extern char ** _org_environ; 30 33 31 extern char _cdll_flag;32 33 void _cleanup (void);34 35 34 #if defined (__cplusplus) 36 35 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/thread.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 7 7 extern "C" { 8 8 #endif 9 10 #if defined (__MT__)11 9 12 10 #if !defined (_TM) … … 53 51 struct _thread *_thread (void); 54 52 55 #endif /* defined (__MT__) */56 57 53 58 54 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/umalloc.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 598 598 /* Each thread has its own default heap. */ 599 599 600 #if defined (__MT__)601 600 #define _UM_DEFAULT_REGULAR_HEAP tp->_th_rheap 602 601 #define _UM_DEFAULT_TILED_HEAP tp->_th_theap 603 602 #define _UM_MT_DECL struct _thread *tp = _thread (); 604 #else605 #define _UM_DEFAULT_REGULAR_HEAP _um_regular_heap606 #define _UM_DEFAULT_TILED_HEAP _um_tiled_heap607 #define _UM_MT_DECL608 #endif609 603 610 604 /* Note that _um_regular_heap is declared in <umalloc.h>. … … 735 729 static __inline__ void _um_heap_lock (Heap_t h) 736 730 { 737 #if defined (__MT__)738 731 _rmutex_checked_request (&h->rsem, _FMR_IGNINT); 739 #endif740 732 } 741 733 … … 743 735 static __inline__ void _um_heap_unlock (Heap_t h) 744 736 { 745 #if defined (__MT__)746 737 _rmutex_checked_release (&h->rsem); 747 #endif748 738 } 749 739 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/os2thunk.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 6 6 typedef unsigned long _far16ptr; 7 7 8 _far16ptr _ emx_32to16 (void *ptr);9 void *_ emx_16to32 (_far16ptr ptr);8 _far16ptr _libc_32to16 (void *ptr); 9 void *_libc_16to32 (_far16ptr ptr); 10 10 11 unsigned long _ emx_thunk1 (void *args, void *fun);11 unsigned long _libc_thunk1 (void *args, void *fun); 12 12 13 13 #define _THUNK_PASCAL_PROLOG(SIZE) \ … … 17 17 #define _THUNK_PASCAL_SHORT(ARG) (*--((unsigned short *)_tp) = (ARG)) 18 18 #define _THUNK_PASCAL_LONG(ARG) (*--((unsigned long *)_tp) = (ARG)) 19 #define _THUNK_PASCAL_FLAT(ARG) _THUNK_PASCAL_LONG (_ emx_32to16 (ARG))19 #define _THUNK_PASCAL_FLAT(ARG) _THUNK_PASCAL_LONG (_libc_32to16 (ARG)) 20 20 #define _THUNK_PASCAL_FAR16(ARG) _THUNK_PASCAL_LONG (ARG) 21 21 #define _THUNK_PASCAL_FUNCTION(FUN) APIENTRY _16_##FUN 22 #define _THUNK_PASCAL_CALL(FUN) _ emx_thunk1 (_tb, (void *)(_16_##FUN)); })23 #define _THUNK_PASCAL_CALLI(FUN) _ emx_thunk1 (_tb, (void *)(FUN)); })22 #define _THUNK_PASCAL_CALL(FUN) _libc_thunk1 (_tb, (void *)(_16_##FUN)); }) 23 #define _THUNK_PASCAL_CALLI(FUN) _libc_thunk1 (_tb, (void *)(FUN)); }) 24 24 25 25 #define _THUNK_C_PROLOG(SIZE) \ … … 29 29 #define _THUNK_C_SHORT(ARG) (*((unsigned short *)_tp)++ = (ARG)) 30 30 #define _THUNK_C_LONG(ARG) (*((unsigned long *)_tp)++ = (ARG)) 31 #define _THUNK_C_FLAT(ARG) _THUNK_C_LONG (_ emx_32to16 (ARG))31 #define _THUNK_C_FLAT(ARG) _THUNK_C_LONG (_libc_32to16 (ARG)) 32 32 #define _THUNK_C_FAR16(ARG) _THUNK_C_LONG (ARG) 33 33 #define _THUNK_C_FUNCTION(FUN) _16__##FUN 34 #define _THUNK_C_CALL(FUN) _ emx_thunk1 (_tb, (void *)(_16__##FUN)); })35 #define _THUNK_C_CALLI(FUN) _ emx_thunk1 (_tb, (void *)(FUN)); })34 #define _THUNK_C_CALL(FUN) _libc_thunk1 (_tb, (void *)(_16__##FUN)); }) 35 #define _THUNK_C_CALLI(FUN) _libc_thunk1 (_tb, (void *)(FUN)); }) 36 36 37 37 #define _THUNK_PROLOG(SIZE) _THUNK_PASCAL_PROLOG (SIZE) … … 46 46 47 47 #define MAKE16P(sel,off) ((_far16ptr)((sel) << 16 | (off))) 48 #define MAKEP(sel,off) _ emx_16to32 (MAKE16P (sel, off))48 #define MAKEP(sel,off) _libc_16to32 (MAKE16P (sel, off)) 49 49 #define SELECTOROF(farptr) ((SEL)((farptr) >> 16)) 50 50 #define OFFSETOF(farptr) ((USHORT)(farptr)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stdio.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 112 112 #if !defined (_VA_LIST) 113 113 #define _VA_LIST 114 typedef char *va_list;114 typedef __builtin_va_list va_list; 115 115 #endif 116 116 … … 159 159 int _rmtmp (void); 160 160 161 int _getc_inline (FILE *);162 int _putc_inline (int, FILE *);163 164 161 extern __inline__ int feof (FILE *_s) 165 162 { … … 172 169 } 173 170 174 /* Do not use this function in application programs! */175 176 extern __inline__ int _getc_inline (FILE *_s)177 {178 return (--_s->_rcount >= 0179 ? (unsigned char)*_s->_ptr++180 : _fill (_s));181 }182 183 /* Do not use this function in application programs! */184 185 extern __inline__ int _putc_inline (int _c, FILE *_s)186 {187 return (--_s->_wcount >= 0 && (_c != '\n' || !(_s->_flags & _IOLBF))188 ? (unsigned char)(*_s->_ptr++ = (char)_c)189 : _flush (_c, _s));190 }191 192 #if defined (__MT__)193 194 171 #define getc(s) fgetc(s) 195 172 #define putc(c,s) fputc(c,s) 196 197 #else198 199 #define getc(s) _getc_inline(s)200 #define putc(c,s) _putc_inline(c,s)201 202 #endif203 173 204 174 extern __inline__ int getchar (void) { return getc (stdin); } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stdlib.h
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 116 116 #if !defined (_ERRNO) 117 117 #define _ERRNO 118 #if defined (__MT__) || defined (__ST_MT_ERRNO__)119 118 extern int *_errno (void); 120 119 #define errno (*_errno ()) 121 #else122 extern int errno;123 #endif124 120 #endif 125 121 … … 148 144 extern __const__ int sys_nerr; 149 145 150 extern __const__ unsigned int _emx_vcmp;151 extern __const__ unsigned int _emx_env;152 extern __const__ unsigned int _emx_rev;153 146 extern __const__ unsigned char _osminor; 154 147 extern __const__ unsigned char _osmajor; 155 extern __const__ unsigned char _osmode; 156 extern __const__ char _emx_vprt[5]; 157 148 149 /* No DOS support ... */ 150 #define _osmode OS2_MODE 158 151 159 152 unsigned alarm (unsigned); … … 263 256 void _wildcard (int *, char ***); 264 257 265 #if defined (__MT__)266 258 int _beginthread (void (*)(void *), void *, unsigned, void *); 267 259 void _endthread (void); 268 260 void **_threadstore (void); 269 #endif270 261 271 262 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/string.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 58 58 char *strdup (__const__ char *); 59 59 int stricmp (__const__ char *, __const__ char *); 60 int strcasecmp (__const__ char *, __const__ char *); 60 61 char *strlwr (char *); 61 62 int strnicmp (__const__ char *, __const__ char *, size_t); 63 int strncasecmp (__const__ char *, __const__ char *, size_t); 62 64 char *strnset (char *, int, size_t); 63 65 char *strrev (char *); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/errno.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 10 10 #if !defined (__ASSEMBLER__) && !defined (_ERRNO) 11 11 #define _ERRNO 12 #if defined (__MT__) || defined (__ST_MT_ERRNO__)13 12 extern int *_errno (void); 14 13 #define errno (*_errno ()) 15 #else16 extern int errno;17 #endif18 14 #endif 19 15 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/omflib.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 10 10 #endif 11 11 12 #ifndef _BYTE_WORD_DWORD 13 #define _BYTE_WORD_DWORD 14 typedef unsigned char byte; 15 typedef unsigned short word; 16 typedef unsigned long dword; 17 #endif /* _BYTE_WORD_DWORD */ 12 18 13 19 #if !defined (THEADR) 14 20 15 #define THEADR 0x80 16 #define LHEADR 0x82 17 #define COMENT 0x88 18 #define MODEND 0x8a 19 #define PUBDEF 0x90 20 #define ALIAS 0xc6 21 #define LIBHDR 0xf0 22 #define LIBEND 0xf1 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 COMDAT 0xc2 /* Common block */ 38 #define ALIAS 0xc6 /* Alias definition record */ 39 #define LIBHDR 0xf0 /* Library header */ 40 #define LIBEND 0xf1 /* Library end */ 23 41 24 #define REC32 0x01 42 /* Add this constant (using the | operator) to get the 32-bit variant 43 of a record type. Some fields will contain 32-bit values instead 44 of 16-bit values. */ 45 #define REC32 0x01 25 46 26 47 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/uio.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 48 48 /** @name tcpip40 function mappings. 49 49 * @{ */ 50 #define readv tcpip40_readv51 #define writevtcpip40_writev50 //@@@ name conflict - a.z. #define readv tcpip40_readv 51 //@@@ name conflict - a.z. #define writev tcpip40_writev 52 52 /* @} */ 53 53 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/mkimplib.smak
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 4 4 5 5 include common.smak 6 7 libs: $(.MODULE) 6 8 7 9 # The rule for building an archive -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/mklib.smak
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 4 4 5 5 include common.smak 6 7 libs: $(.MODULE) 6 8 7 9 # The rule for building an archive -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/mkomflib.smak
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 25 25 MODULES += $(.MODULE)@omf 26 26 27 DO.INSTALL += $(call CP,$.$(.TARG@OMF),$(INS)$(.INSDIR)$(.TARGET))$(NL) 27 INS.FILES += $(INS)$(.INSDIR)$(.TARGET) 28 $(INS)$(.INSDIR)$(.TARGET): $.$(.TARG@OMF) 29 $(call CP,$<,$@) 28 30 29 31 .DIRS@OMF := $(dir $.$(.TARG@OMF)) … … 35 37 # Add a dependency rule to help make 36 38 # (avoids that dumb 'dunno how to make' message) 37 RULES += $(call FECHO,_@,$.$(.TARG@OMF): $.$(.TARG))$(NL)39 $.$(.TARG@OMF): $.$(.TARG) 38 40 39 41 endif # neq ($(findstring aout,$(.TKIND)),) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/cmd.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 66 66 my_write (&str_len, sizeof (str_len), &inp_file); 67 67 my_trunc (&inp_file); 68 a_in_h. sym_size= 0;68 a_in_h.a_syms = 0; 69 69 my_seek (&inp_file, a_in_pos); 70 70 my_write (&a_in_h, sizeof (a_in_h), &inp_file); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/emxbind.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r235 r236 39 39 /* The banner line of emxbind. */ 40 40 41 static char *title = "emxbind " VERSION INNOTEK_VERSION" -- "41 static char *title = "emxbind " VERSION " -- " 42 42 "Copyright (c) 1991-1997 by Eberhard Mattes"; 43 43 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/emxbind.h
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r235 r236 19 19 Boston, MA 02111-1307, USA. */ 20 20 21 22 #include "a_out.h" 21 23 22 24 #if defined (EXTERN) … … 31 33 /* By default, don't implement the -L option (for listing the headers 32 34 of an EXE file). */ 33 34 /* This is the version number. */35 36 #define VERSION "0.9d"37 #include "../../../../include/innotekversion.h"38 35 39 36 /* Put this at the end of a function declaration to tell the compiler … … 277 274 /* The a.out header read from the source a.out (sub)file. */ 278 275 279 EXTERN struct a_out_headera_in_h;276 EXTERN struct exec a_in_h; 280 277 281 278 /* The fixed part of the LX header. */ … … 335 332 respectively, as read from the source a.out file. */ 336 333 337 EXTERN struct reloc *tr_image INIT (NULL);338 EXTERN struct reloc *dr_image INIT (NULL);334 EXTERN struct relocation_info *tr_image INIT (NULL); 335 EXTERN struct relocation_info *dr_image INIT (NULL); 339 336 340 337 /* This array contains the symbol table, as read from the source a.out -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/emxbind.smak
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 7 7 .TKIND := $(TOOLFMT) 8 8 .TSRC := $(wildcard src/emxbind/*.c) 9 .TCF := $(CFLAGS.DEF.VERSION) 9 10 .TLDF := -lmoddef 10 11 .TKEEP := 1 … … 12 13 13 14 .TARG := $(TOOLFMT)/os2stub.bin 14 DO.INSTALL += $(call CP,$.$(.TARG),$(INS)$(.INSDIR))$(NL)15 15 16 16 emxbind: $.$(.TARG) … … 19 19 $(call CP,$< $@) 20 20 21 INS.FILES += $(INS)$(.INSDIR)os2stub.bin 22 23 $(INS)$(.INSDIR)os2stub.bin: $.$(.TARG) 24 $(call CP,$^,$@) 25 21 26 include comend.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/exec.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 29 29 30 30 31 /* Magic number for a.out executable files as used by emx. */32 33 #define A_OUT_MAGIC 0x010b34 35 36 31 /* The first DOS EXE header read from emxl.exe or emx.exe. */ 37 32 … … 40 35 /* The a.out header to be written to the output executable. */ 41 36 42 static struct a_out_headera_out_h;37 static struct exec a_out_h; 43 38 44 39 /* The header of the core dump file. */ … … 177 172 my_read (&a_in_h, sizeof (a_in_h), &inp_file); 178 173 a_out_h = a_in_h; 179 if ( a_in_h.magic != A_OUT_MAGIC || a_in_h.entry != TEXT_BASE)174 if (N_MAGIC (a_in_h) != ZMAGIC || a_in_h.a_entry != TEXT_BASE) 180 175 error ("invalid a.out file (header)"); 181 a_out_h. drsize = 0;182 a_out_h. trsize = 0;176 a_out_h.a_drsize = 0; 177 a_out_h.a_trsize = 0; 183 178 my_seek (&inp_file, A_OUT_OFFSET); 184 179 my_read (buf, sizeof (buf), &inp_file); 185 180 a_in_text = A_OUT_OFFSET; 186 a_in_data = a_in_text + round_page (a_in_h. text_size);187 a_in_tr = a_in_data + round_page (a_in_h. data_size);188 a_in_dr = a_in_tr + a_in_h. trsize;189 a_in_sym = a_in_dr + a_in_h. drsize;190 data_base = round_segment (TEXT_BASE + a_in_h. text_size);181 a_in_data = a_in_text + round_page (a_in_h.a_text); 182 a_in_tr = a_in_data + round_page (a_in_h.a_data); 183 a_in_dr = a_in_tr + a_in_h.a_trsize; 184 a_in_sym = a_in_dr + a_in_h.a_drsize; 185 data_base = round_segment (TEXT_BASE + a_in_h.a_text); 191 186 text_off = a_in_pos + a_in_text - TEXT_BASE; 192 187 data_off = a_in_pos + a_in_data - data_base; 193 syms = (a_in_h. sym_size!= 0 &&194 a_in_sym + a_in_h. sym_size+ sizeof (a_in_str_size) <=188 syms = (a_in_h.a_syms != 0 && 189 a_in_sym + a_in_h.a_syms + sizeof (a_in_str_size) <= 195 190 my_size (&inp_file)); 196 191 if (syms) 197 192 { 198 a_in_str = a_in_sym + a_in_h. sym_size;193 a_in_str = a_in_sym + a_in_h.a_syms; 199 194 my_seek (&inp_file, a_in_str); 200 195 my_read (&a_in_str_size, sizeof (a_in_str_size), &inp_file); … … 214 209 a_out_str = a_in_sym; 215 210 a_out_str_size = 4; 216 a_out_h. sym_size= 0;217 } 218 a_out_str -= a_in_h. drsize + a_in_h.trsize;211 a_out_h.a_syms = 0; 212 } 213 a_out_str -= a_in_h.a_drsize + a_in_h.a_trsize; 219 214 a_out_size = a_out_str + a_out_str_size; 220 215 } … … 229 224 error ("invalid core file (header)"); 230 225 if (core_h.u_data_base != data_base 231 || core_h.u_data_end != data_base + a_in_h. data_size + a_in_h.bss_size)226 || core_h.u_data_end != data_base + a_in_h.a_data + a_in_h.a_bss) 232 227 error ("core file doesn't match a.out file"); 233 a_out_h. data_size= round_page (core_h.u_data_end - core_h.u_data_base);234 a_out_h. bss_size= 0;228 a_out_h.a_data = round_page (core_h.u_data_end - core_h.u_data_base); 229 a_out_h.a_bss = 0; 235 230 if (core_h.u_heap_brk > core_h.u_heap_base) 236 231 { 237 232 if (core_h.u_heap_brk - core_h.u_heap_base > heap_size) 238 233 error ("the heap size is too small for the core file's heap"); 239 a_out_h. data_size= round_page (core_h.u_heap_brk - core_h.u_data_base);234 a_out_h.a_data = round_page (core_h.u_heap_brk - core_h.u_data_base); 240 235 } 241 236 if (core_h.u_heapobjs_off != 0) … … 264 259 { 265 260 my_seek (&inp_file, a_in_tr); 266 tr_image = xmalloc (a_in_h. trsize);267 my_read (tr_image, a_in_h. trsize, &inp_file);261 tr_image = xmalloc (a_in_h.a_trsize); 262 my_read (tr_image, a_in_h.a_trsize, &inp_file); 268 263 } 269 264 if (dr_image == NULL) 270 265 { 271 266 my_seek (&inp_file, a_in_dr); 272 dr_image = xmalloc (a_in_h. drsize);273 my_read (dr_image, a_in_h. drsize, &inp_file);267 dr_image = xmalloc (a_in_h.a_drsize); 268 my_read (dr_image, a_in_h.a_drsize, &inp_file); 274 269 } 275 270 } … … 284 279 if (text_image == NULL) 285 280 { 286 t_size = round_page (a_in_h. text_size);281 t_size = round_page (a_in_h.a_text); 287 282 text_image = xmalloc (t_size); 288 283 my_seek (&inp_file, a_in_text); … … 291 286 if (data_image == NULL) 292 287 { 293 d_size = round_page (a_in_h. data_size);288 d_size = round_page (a_in_h.a_data); 294 289 data_image = xmalloc (d_size); 295 290 my_seek (&inp_file, a_in_data); … … 305 300 if (sym_image == NULL) 306 301 { 307 sym_image = xmalloc (a_in_h. sym_size);302 sym_image = xmalloc (a_in_h.a_syms); 308 303 str_image = xmalloc (a_in_str_size); 309 304 my_seek (&inp_file, a_in_sym); 310 my_read (sym_image, a_in_h. sym_size, &inp_file);305 my_read (sym_image, a_in_h.a_syms, &inp_file); 311 306 my_seek (&inp_file, a_in_str); 312 307 my_read (str_image, a_in_str_size, &inp_file); 313 sym_count = a_in_h. sym_size/ sizeof (struct nlist);308 sym_count = a_in_h.a_syms / sizeof (struct nlist); 314 309 build_sym_hash_table (); 315 310 } … … 387 382 out_h2.new_lo = LOWORD (os2_hdr_pos); 388 383 out_h2.new_hi = HIWORD (os2_hdr_pos); 389 obj_text.virt_size = a_in_h. text_size;390 obj_data.virt_size = a_in_h. data_size + a_in_h.bss_size;384 obj_text.virt_size = a_in_h.a_text; 385 obj_data.virt_size = a_in_h.a_data + a_in_h.a_bss; 391 386 obj_stk0.virt_size = stack_size; 392 obj_data.virt_base = round_segment (obj_text.virt_base + a_in_h. text_size);387 obj_data.virt_base = round_segment (obj_text.virt_base + a_in_h.a_text); 393 388 obj_heap.virt_base = round_segment (OBJ_END (obj_data)); 394 389 obj_stk0.virt_base = round_segment (OBJ_END (obj_heap)); 395 390 os2_h.stack_esp = obj_stk0.virt_size; 396 text_pages = npages (a_in_h. text_size);391 text_pages = npages (a_in_h.a_text); 397 392 heap_pages = 0; gap_pages = 0; 398 393 if (opt_c != NULL) 399 394 { 400 data_pages = npages (a_in_h. data_size + a_in_h.bss_size);395 data_pages = npages (a_in_h.a_data + a_in_h.a_bss); 401 396 heap_pages = npages (core_h.u_heap_brk - core_h.u_heap_base); 402 397 … … 408 403 } 409 404 else 410 data_pages = npages (a_in_h. data_size);405 data_pages = npages (a_in_h.a_data); 411 406 412 407 /* The object page table and the fixup page table don't include the … … 783 778 my_seek (&inp_file, a_in_text); 784 779 if (text_image != NULL) 785 my_write (text_image, round_page (a_in_h. text_size), &out_file);780 my_write (text_image, round_page (a_in_h.a_text), &out_file); 786 781 else 787 copy (&inp_file, round_page (a_in_h. text_size));782 copy (&inp_file, round_page (a_in_h.a_text)); 788 783 if (opt_c != NULL) 789 784 { … … 802 797 } 803 798 else if (data_image != NULL) 804 my_write (data_image, round_page (a_in_h. data_size), &out_file);799 my_write (data_image, round_page (a_in_h.a_data), &out_file); 805 800 else 806 801 { 807 802 my_seek (&inp_file, a_in_data); 808 copy (&inp_file, round_page (a_in_h. data_size));809 } 810 if (a_out_h. sym_size== 0)803 copy (&inp_file, round_page (a_in_h.a_data)); 804 } 805 if (a_out_h.a_syms == 0) 811 806 { 812 807 str_len = 4; … … 816 811 { 817 812 if (sym_image != NULL) 818 my_write (sym_image, a_out_h. sym_size, &out_file);813 my_write (sym_image, a_out_h.a_syms, &out_file); 819 814 else 820 815 { 821 816 my_seek (&inp_file, a_in_sym); 822 copy (&inp_file, a_out_h. sym_size);817 copy (&inp_file, a_out_h.a_syms); 823 818 } 824 819 if (str_image != NULL) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/export.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 139 139 if (export_len != 0) 140 140 { 141 if (a_in_h. sym_size== 0 || a_in_str_size == 0)141 if (a_in_h.a_syms == 0 || a_in_str_size == 0) 142 142 error ("need symbol table for EXPORTS"); 143 143 read_sym (); … … 151 151 if (nl == NULL) 152 152 error ("symbol %s undefined (EXPORTS)", export_data[i].internalname); 153 switch (nl-> type & ~N_EXT)153 switch (nl->n_type & ~N_EXT) 154 154 { 155 155 case N_TEXT: 156 export_data[i].offset = nl-> value - obj_text.virt_base;156 export_data[i].offset = nl->n_value - obj_text.virt_base; 157 157 export_data[i].object = OBJ_TEXT; 158 158 break; 159 159 case N_BSS: 160 160 case N_DATA: 161 export_data[i].offset = nl-> value - obj_data.virt_base;161 export_data[i].offset = nl->n_value - obj_data.virt_base; 162 162 export_data[i].object = OBJ_DATA; 163 163 break; 164 164 default: 165 165 error ("cannot export symbol %s of type %d", 166 export_data[i].internalname, nl-> type);166 export_data[i].internalname, nl->n_type); 167 167 } 168 168 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/fixup.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 90 90 for (i = 0; i < sym_count; ++i) 91 91 { 92 name = sym_image[i]. string+ str_image;92 name = sym_image[i].n_un.n_strx + str_image; 93 93 hash = sym_hash (name); 94 94 sym_hash_next[i] = sym_hash_table[hash]; … … 112 112 j = sym_hash_next[j]) 113 113 { 114 const char *name2 = sym_image[j]. string+ str_image;114 const char *name2 = sym_image[j].n_un.n_strx + str_image; 115 115 116 116 if (memcmp (name1, name2, len) == 0) 117 117 { 118 int t = sym_image[j]. type & ~N_EXT;118 int t = sym_image[j].n_type & ~N_EXT; 119 119 if (t == N_TEXT || t == N_DATA || t == N_BSS) 120 120 return sym_image+j; … … 342 342 /* Build fixups for the relocation table TABLE. */ 343 343 344 static void reloc_table (const struct reloc *table, long tab_size, int seg_obj,344 static void reloc_table (const struct relocation_info *table, long tab_size, int seg_obj, 345 345 dword seg_base, const byte *image, dword image_size) 346 346 { 347 347 int n, obj; 348 const struct reloc *r;348 const struct relocation_info *r; 349 349 dword x, dst_base; 350 350 351 n = tab_size / sizeof (struct reloc );351 n = tab_size / sizeof (struct relocation_info); 352 352 for (r = table; n > 0; --n, ++r) 353 353 { 354 if (r-> length != 2)355 error ("relocation of size %d not implemented", 1 << r-> length);356 switch (r-> symbolnum & ~N_EXT)354 if (r->r_length != 2) 355 error ("relocation of size %d not implemented", 1 << r->r_length); 356 switch (r->r_symbolnum & ~N_EXT) 357 357 { 358 358 case N_TEXT: … … 370 370 break; 371 371 } 372 if (obj >= 0 && (!r-> pcrel || obj != seg_obj))372 if (obj >= 0 && (!r->r_pcrel || obj != seg_obj)) 373 373 { 374 374 grow_fixup (); 375 if (r-> address+3 >= image_size)375 if (r->r_address+3 >= image_size) 376 376 error ("fixup outside image"); 377 x = *(dword *)(image + r-> address);378 if (r-> pcrel)379 x += dst_base + r-> address + 4;380 fixup_data[fixup_len].type = (r-> pcrel ? FIXUP_REL : FIXUP_ABS);377 x = *(dword *)(image + r->r_address); 378 if (r->r_pcrel) 379 x += dst_base + r->r_address + 4; 380 fixup_data[fixup_len].type = (r->r_pcrel ? FIXUP_REL : FIXUP_ABS); 381 381 fixup_data[fixup_len].target = TARGET_ADDR; 382 382 fixup_data[fixup_len].obj = seg_obj; 383 383 fixup_data[fixup_len].mod = obj; 384 fixup_data[fixup_len].addr = r-> address;384 fixup_data[fixup_len].addr = r->r_address; 385 385 fixup_data[fixup_len].dst = x - dst_base; 386 386 fixup_data[fixup_len].add = 0; … … 443 443 void relocations (void) 444 444 { 445 if (relocatable && (a_in_h. trsize != 0 || a_in_h.drsize != 0))445 if (relocatable && (a_in_h.a_trsize != 0 || a_in_h.a_drsize != 0)) 446 446 { 447 447 read_segs (); 448 448 read_reloc (); 449 reloc_table (tr_image, a_in_h. trsize, OBJ_TEXT, TEXT_BASE,450 text_image, a_in_h. text_size);451 reloc_table (dr_image, a_in_h. drsize, OBJ_DATA, data_base,452 data_image, a_in_h. data_size);449 reloc_table (tr_image, a_in_h.a_trsize, OBJ_TEXT, TEXT_BASE, 450 text_image, a_in_h.a_text); 451 reloc_table (dr_image, a_in_h.a_drsize, OBJ_DATA, data_base, 452 data_image, a_in_h.a_data); 453 453 } 454 454 } … … 457 457 /* Process an import symbol for method (I2). */ 458 458 459 static void import_symbol (int seg_obj, const struct reloc *r,459 static void import_symbol (int seg_obj, const struct relocation_info *r, 460 460 const char *name1, int len, dword x, 461 461 const char *name2) … … 494 494 if (memcmp ("_16_", name1, 4) == 0) 495 495 { 496 if (r-> pcrel)496 if (r->r_pcrel) 497 497 error ("pc-relative 16:16 fixup is invalid"); 498 498 fixup_type = FIXUP_FAR16; 499 499 } 500 500 else 501 fixup_type = (r-> pcrel ? FIXUP_REL : FIXUP_ABS);502 ref_proc (name1, seg_obj, r-> address, mod_idx, proc, (int)ord,501 fixup_type = (r->r_pcrel ? FIXUP_REL : FIXUP_ABS); 502 ref_proc (name1, seg_obj, r->r_address, mod_idx, proc, (int)ord, 503 503 fixup_type, x); 504 504 } … … 508 508 records. */ 509 509 510 void import_reloc (const struct reloc *table, long tab_size,510 void import_reloc (const struct relocation_info *table, long tab_size, 511 511 int seg_obj, dword seg_base, const byte *image, 512 512 dword image_size) 513 513 { 514 514 int reloc_count, i, j, len, ok; 515 const struct reloc *r;515 const struct relocation_info *r; 516 516 const char *name1, *name2; 517 517 dword x; 518 518 519 reloc_count = tab_size / sizeof (struct reloc );519 reloc_count = tab_size / sizeof (struct relocation_info); 520 520 for (i = 0, r = table; i < reloc_count; ++i, ++r) 521 if (r-> ext && r->length == 2)521 if (r->r_extern && r->r_length == 2) 522 522 { 523 523 if (sym_image == NULL) 524 524 read_sym (); 525 if (r-> symbolnum >= sym_count)525 if (r->r_symbolnum >= sym_count) 526 526 error ("invalid symbol number"); 527 if (sym_image[r-> symbolnum].type == (N_IMP1|N_EXT))527 if (sym_image[r->r_symbolnum].n_type == (N_IMP1|N_EXT)) 528 528 { 529 if (r-> address+3 >= image_size)529 if (r->r_address+3 >= image_size) 530 530 error ("fixup outside image"); 531 x = *(dword *)(image + r-> address);532 if (r-> pcrel)533 x += seg_base + r-> address + 4;534 name1 = sym_image[r-> symbolnum].string+ str_image;531 x = *(dword *)(image + r->r_address); 532 if (r->r_pcrel) 533 x += seg_base + r->r_address + 4; 534 name1 = sym_image[r->r_symbolnum].n_un.n_strx + str_image; 535 535 len = strlen (name1); 536 536 ok = FALSE; 537 537 for (j = sym_hash_table[sym_hash (name1)]; j != -1; 538 538 j = sym_hash_next[j]) 539 if (sym_image[j]. type == (N_IMP2|N_EXT))539 if (sym_image[j].n_type == (N_IMP2|N_EXT)) 540 540 { 541 name2 = sym_image[j]. string+ str_image;541 name2 = sym_image[j].n_un.n_strx + str_image; 542 542 if (memcmp (name1, name2, len) == 0 && name2[len] == '=') 543 543 { … … 625 625 free (set_vec); 626 626 } 627 if (a_in_h. trsize != 0 || a_in_h.drsize != 0)627 if (a_in_h.a_trsize != 0 || a_in_h.a_drsize != 0) 628 628 { 629 629 read_segs (); 630 630 read_reloc (); 631 import_reloc (tr_image, a_in_h. trsize, OBJ_TEXT, TEXT_BASE, text_image,632 a_in_h. text_size);633 import_reloc (dr_image, a_in_h. drsize, OBJ_DATA, data_base, data_image,634 a_in_h. data_size);631 import_reloc (tr_image, a_in_h.a_trsize, OBJ_TEXT, TEXT_BASE, text_image, 632 a_in_h.a_text); 633 import_reloc (dr_image, a_in_h.a_drsize, OBJ_DATA, data_base, data_image, 634 a_in_h.a_data); 635 635 } 636 636 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxbind/map.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 64 64 seg = 0; 65 65 text_seg = ++seg; 66 fprintf (map_file, fmt, seg, 0, a_in_h. text_size, "TEXT32", "CODE");66 fprintf (map_file, fmt, seg, 0, a_in_h.a_text, "TEXT32", "CODE"); 67 67 first_dgroup_seg = data_seg = ++seg; 68 fprintf (map_file, fmt, seg, 0, a_in_h. data_size, "DATA32", "DATA");69 fprintf (map_file, fmt, seg, a_in_h. data_size, a_in_h.bss_size, "BSS32", "BSS");68 fprintf (map_file, fmt, seg, 0, a_in_h.a_data, "DATA32", "DATA"); 69 fprintf (map_file, fmt, seg, a_in_h.a_data, a_in_h.a_bss, "BSS32", "BSS"); 70 70 71 71 if (obj_heap.virt_size != 0) … … 200 200 for (i = 0; i < sym_count; ++i) 201 201 { 202 switch (sym_image[i]. type)202 switch (sym_image[i].n_type) 203 203 { 204 204 case N_TEXT|N_EXT: 205 seg = text_seg; addr = sym_image[i]. value - obj_text.virt_base;205 seg = text_seg; addr = sym_image[i].n_value - obj_text.virt_base; 206 206 break; 207 207 case N_DATA|N_EXT: 208 208 case N_BSS|N_EXT: 209 seg = data_seg; addr = sym_image[i]. value - obj_data.virt_base;209 seg = data_seg; addr = sym_image[i].n_value - obj_data.virt_base; 210 210 break; 211 211 default: … … 215 215 { 216 216 grow_map_sym_table (); 217 name = sym_image[i]. string+ str_image;217 name = sym_image[i].n_un.n_strx + str_image; 218 218 map_sym_table[map_sym_count].seg = seg; 219 219 map_sym_table[map_sym_count].addr = addr; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxcat/emxcat.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 24 24 #include <string.h> 25 25 #include <ctype.h> 26 27 #define VERSION "0.9d"28 #include "../../../../include/innotekversion.h"29 26 30 27 #define NORETURN volatile … … 85 82 static void NORETURN usage (void) 86 83 { 87 fprintf (stderr, "emxcat " VERSION INNOTEK_VERSION" -- "84 fprintf (stderr, "emxcat " VERSION " -- " 88 85 "Copyright (c) 1992-1995 by Eberhard Mattes\n\n"); 89 86 fprintf (stderr, "Usage: emxcat [-D<symbol>]... -o <output_file> <input_file>...\n"); … … 97 94 { 98 95 void *p; 99 96 100 97 p = malloc (n); 101 98 if (p == NULL) … … 114 111 { 115 112 char *p; 116 113 117 114 p = xmalloc (strlen (s) + 1); 118 115 strcpy (p, s); … … 306 303 { 307 304 edge *e; 308 305 309 306 v->mark = 1; 310 307 v->number = vn++; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxdoc/emxdoc.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 39 39 #include "cond.h" 40 40 41 #define VERSION "0.9d"42 #include "../../../../include/innotekversion.h"43 44 41 struct word_table 45 42 { … … 188 185 static void usage (void) 189 186 { 190 fputs ("emxdoc " VERSION INNOTEK_VERSION" -- "187 fputs ("emxdoc " VERSION " -- " 191 188 "Copyright (c) 1993-1999 by Eberhard Mattes\n\n", stderr); 192 189 fputs ("Usage:\n", stderr); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxexp/emxexp.c
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r235 r236 27 27 #include <errno.h> 28 28 #include <ar.h> 29 #include <sys/omflib.h> 30 #include <a_out.h> 29 31 #include "defs.h" 30 #include <sys/omflib.h>31 32 #include "demangle.h" 32 33 #define VERSION "0.9d"34 #include "../../../../include/innotekversion.h"35 33 36 34 struct bss_list … … 75 73 { 76 74 void *p; 77 75 78 76 p = malloc (n); 79 77 if (p == NULL) … … 90 88 { 91 89 void *p; 92 90 93 91 p = realloc (ptr, n); 94 92 if (p == NULL) … … 102 100 static void usage (void) 103 101 { 104 fputs ("emxexp " VERSION INNOTEK_VERSION" -- Copyright (c) 1993-1995 by Eberhard Mattes\n\n"102 fputs ("emxexp " VERSION " -- Copyright (c) 1993-1995 by Eberhard Mattes\n\n" 105 103 "Usage: emxexp [-n] [-u] [-o[<ordinal>] <input_file>...\n\n" 106 104 "Options:\n" … … 170 168 { 171 169 byte *inp_buf; 172 const struct a_out_header*a_out_h;170 const struct exec *a_out_h; 173 171 const byte *sym; 174 172 const struct nlist *sym_ptr; … … 183 181 size = fread (inp_buf, 1, size, inp_file); 184 182 185 a_out_h = (struct a_out_header*)inp_buf;186 if (size < sizeof (struct a_out_header) || a_out_h->magic != 0407)183 a_out_h = (struct exec *)inp_buf; 184 if (size < sizeof (struct exec) || N_MAGIC (*a_out_h) != OMAGIC) 187 185 error ("Malformed input file `%s'", inp_fname); 188 sym = (inp_buf + sizeof (struct a_out_header) + a_out_h->text_size189 + a_out_h-> data_size + a_out_h->trsize + a_out_h->drsize);190 if (!a_out_h-> sym_size)186 sym = (inp_buf + sizeof (struct exec) + a_out_h->a_text 187 + a_out_h->a_data + a_out_h->a_trsize + a_out_h->a_drsize); 188 if (!a_out_h->a_syms) 191 189 return; 192 str_ptr = sym + a_out_h-> sym_size;190 str_ptr = sym + a_out_h->a_syms; 193 191 if (str_ptr + 4 - inp_buf > size) 194 192 error ("Malformed input file `%s'", inp_fname); 195 193 str_size = *(long *)str_ptr; 196 194 sym_ptr = (const struct nlist *)sym; 197 sym_count = a_out_h-> sym_size/ sizeof (struct nlist);195 sym_count = a_out_h->a_syms / sizeof (struct nlist); 198 196 if (str_ptr + str_size - inp_buf > size) 199 197 error ("Malformed input file `%s'", inp_fname); 200 198 201 199 for (i = 0; i < sym_count; ++i) 202 if (sym_ptr[i]. type == (N_TEXT|N_EXT) ||203 sym_ptr[i]. type == (N_DATA|N_EXT) ||200 if (sym_ptr[i].n_type == (N_TEXT|N_EXT) || 201 sym_ptr[i].n_type == (N_DATA|N_EXT) || 204 202 (weak_flag && 205 (sym_ptr[i]. type == N_WEAKT ||206 sym_ptr[i]. type == N_WEAKD)))203 (sym_ptr[i].n_type == N_WEAKT || 204 sym_ptr[i].n_type == N_WEAKD))) 207 205 { 208 name = str_ptr + sym_ptr[i]. string;206 name = str_ptr + sym_ptr[i].n_un.n_strx; 209 207 export (name); 210 208 } 211 else if ((sym_ptr[i]. type == N_EXT ||212 sym_ptr[i]. type == (N_BSS|N_EXT) ||213 (weak_flag && sym_ptr[i]. type == N_WEAKB)) &&214 sym_ptr[i]. value != 0)209 else if ((sym_ptr[i].n_type == N_EXT || 210 sym_ptr[i].n_type == (N_BSS|N_EXT) || 211 (weak_flag && sym_ptr[i].n_type == N_WEAKB)) && 212 sym_ptr[i].n_value != 0) 215 213 { 216 name = str_ptr + sym_ptr[i]. string;214 name = str_ptr + sym_ptr[i].n_un.n_strx; 217 215 export_bss (name); 218 216 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxexp/emxexp.smak
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 7 7 .TKIND := $(TOOLFMT) 8 8 .TSRC := $(wildcard src/emxexp/*.c) 9 .TCF := $(CFLAGS.DEF.VERSION) 9 10 .TDEP := @O@omflib$A 10 11 .TLDF := -liberty -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emximp/emximp.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 30 30 #include <time.h> 31 31 #include <sys/moddef.h> 32 #include <a_out.h> 32 33 #include "defs.h" 33 34 #include <sys/omflib.h> 34 35 #define VERSION "0.9d"36 #include "../../../../include/innotekversion.h"37 35 38 36 #define NORETURN2 __attribute__ ((noreturn)) … … 41 39 #define MOD_DEF 1 42 40 #define MOD_REF 2 43 44 #define N_EXT 0x0145 #define N_ABS 0x0246 #define N_IMP1 0x6847 #define N_IMP2 0x6a48 41 49 42 #define PARMS_REG (-1) … … 108 101 static void usage (void) 109 102 { 110 puts ("emximp " VERSION INNOTEK_VERSION" -- Copyright (c) 1992-1996 by Eberhard Mattes\n");103 puts ("emximp " VERSION " -- Copyright (c) 1992-1996 by Eberhard Mattes\n"); 111 104 puts ("Usage:"); 112 105 puts (" emximp [-a[<assembler>]] [-b <base_name>|<prefix_length>] " … … 612 605 static int aout_text_size; 613 606 614 static struct reloc aout_treloc_tab[2];607 static struct relocation_info aout_treloc_tab[2]; 615 608 static int aout_treloc_count; 616 609 … … 636 629 if (aout_sym_count >= sizeof (aout_sym_tab) / sizeof (aout_sym_tab[0])) 637 630 error ("a.out symbol table overflow"); 638 aout_sym_tab[aout_sym_count]. string= aout_str_size;639 aout_sym_tab[aout_sym_count]. type = type;640 aout_sym_tab[aout_sym_count]. other = other;641 aout_sym_tab[aout_sym_count]. desc = desc;642 aout_sym_tab[aout_sym_count]. value = value;631 aout_sym_tab[aout_sym_count].n_un.n_strx = aout_str_size; 632 aout_sym_tab[aout_sym_count].n_type = type; 633 aout_sym_tab[aout_sym_count].n_other = other; 634 aout_sym_tab[aout_sym_count].n_desc = desc; 635 aout_sym_tab[aout_sym_count].n_value = value; 643 636 strcpy (aout_str_tab + aout_str_size, name); 644 637 aout_str_size += len + 1; … … 667 660 int ext) 668 661 { 669 if (aout_treloc_count >= sizeof (aout_treloc_tab) / sizeof (struct reloc ))662 if (aout_treloc_count >= sizeof (aout_treloc_tab) / sizeof (struct relocation_info)) 670 663 error ("a.out text relocation buffer overflow"); 671 aout_treloc_tab[aout_treloc_count]. address = address;672 aout_treloc_tab[aout_treloc_count]. symbolnum = symbolnum;673 aout_treloc_tab[aout_treloc_count]. pcrel = pcrel;674 aout_treloc_tab[aout_treloc_count]. length = length;675 aout_treloc_tab[aout_treloc_count]. ext= ext;676 aout_treloc_tab[aout_treloc_count]. unused = 0;664 aout_treloc_tab[aout_treloc_count].r_address = address; 665 aout_treloc_tab[aout_treloc_count].r_symbolnum = symbolnum; 666 aout_treloc_tab[aout_treloc_count].r_pcrel = pcrel; 667 aout_treloc_tab[aout_treloc_count].r_length = length; 668 aout_treloc_tab[aout_treloc_count].r_extern = ext; 669 aout_treloc_tab[aout_treloc_count].r_pad = 0; 677 670 ++aout_treloc_count; 678 671 } … … 683 676 while (aout_text_size & 3) 684 677 aout_text_byte (0x90); 685 aout_size = (sizeof (struct a_out_header) + aout_text_size686 + aout_treloc_count * sizeof (struct reloc )678 aout_size = (sizeof (struct exec) + aout_text_size 679 + aout_treloc_count * sizeof (struct relocation_info) 687 680 + aout_sym_count * sizeof (aout_sym_tab[0]) 688 681 + aout_str_size); … … 692 685 static void aout_write (void) 693 686 { 694 struct a_out_headerao;695 696 ao.magic = 0407;697 ao.machtype = 0;698 ao.flags = 0;699 ao. text_size= aout_text_size;700 ao. data_size= 0;701 ao. bss_size= 0;702 ao. sym_size= aout_sym_count * sizeof (aout_sym_tab[0]);703 ao. entry = 0;704 ao. trsize = aout_treloc_count * sizeof (struct reloc);705 ao. drsize = 0;687 struct exec ao; 688 689 N_SET_MAGIC (ao, OMAGIC); 690 N_SET_MACHTYPE (ao, 0); 691 N_SET_FLAGS (ao, 0); 692 ao.a_text = aout_text_size; 693 ao.a_data = 0; 694 ao.a_bss = 0; 695 ao.a_syms = aout_sym_count * sizeof (aout_sym_tab[0]); 696 ao.a_entry = 0; 697 ao.a_trsize = aout_treloc_count * sizeof (struct relocation_info); 698 ao.a_drsize = 0; 706 699 fwrite (&ao, 1, sizeof (ao), out_file); 707 700 fwrite (aout_text, 1, aout_text_size, out_file); 708 fwrite (aout_treloc_tab, aout_treloc_count, sizeof (struct reloc ), out_file);701 fwrite (aout_treloc_tab, aout_treloc_count, sizeof (struct relocation_info), out_file); 709 702 fwrite (aout_sym_tab, aout_sym_count, sizeof (aout_sym_tab[0]), out_file); 710 703 *(dword *)aout_str_tab = aout_str_size; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emximp/emximp.smak
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 7 7 .TKIND := $(TOOLFMT) 8 8 .TSRC := $(wildcard src/emximp/*.c) 9 .TCF := $(CFLAGS.DEF.VERSION) 9 10 .TDEP := @O@omflib$A @O@moddef$A 10 11 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxload/emxload.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 36 36 #define INCL_DOSERRORS 37 37 #include <os2.h> 38 39 #define VERSION "0.9d"40 #include "../../../../include/innotekversion.h"41 38 42 39 /* ------------------------------ SERVER ------------------------------ */ … … 320 317 int i; 321 318 time_t now, stop; 322 319 323 320 stop = 0; 324 321 … … 751 748 static void usage (void) 752 749 { 753 fputs ("emxload " VERSION INNOTEK_VERSION" -- "750 fputs ("emxload " VERSION " -- " 754 751 "Copyright (c) 1993-1996 by Eberhard Mattes\n\n" 755 752 "Usage: emxload [-m <limit>] [-s <limit>] [-e] [-u[w]]\n" -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxload/emxload.smak
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 .TKIND := $(TOOLFMT) 7 7 .TSRC := $(wildcard src/emxload/*.c) 8 .TCF := $(CFLAGS.DEF.VERSION) 8 9 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxaout.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 28 28 #include <sys/param.h> 29 29 #include <sys/emxload.h> 30 #include <sys/omflib.h> 30 31 #include <ar.h> 32 #include <a_out.h> 31 33 32 34 #define GROW_DEF_STATIC(NAME,TYPE) \ … … 42 44 (grow_by (&NAME##_grow, 1), NAME##_grow.count++) 43 45 44 /* The version number of this program. This is printed with the usage45 message. */46 47 #define VERSION "0.9d"48 #include "../../../../include/innotekversion.h"49 50 46 /* Insert private header files. */ 51 47 … … 150 146 GROW_DEF_STATIC (extdefs, struct extdef); 151 147 GROW_DEF_STATIC (symbols, struct symbol); 152 GROW_DEF_STATIC (trelocs, struct reloc );153 GROW_DEF_STATIC (drelocs, struct reloc );148 GROW_DEF_STATIC (trelocs, struct relocation_info); 149 GROW_DEF_STATIC (drelocs, struct relocation_info); 154 150 155 151 … … 212 208 { 213 209 void *p; 214 210 215 211 p = malloc (n); 216 212 if (p == NULL && n != 0) … … 227 223 { 228 224 void *p; 229 225 230 226 p = realloc (ptr, n); 231 227 if (p == NULL) … … 242 238 { 243 239 char *p; 244 240 245 241 p = xmalloc (strlen (s) + 1); 246 242 strcpy (p, s); … … 268 264 static void usage (void) 269 265 { 270 puts ("emxaout " VERSION INNOTEK_VERSION" -- Copyright (c) 1994-1996 by Eberhard Mattes\n");266 puts ("emxaout " VERSION " -- Copyright (c) 1994-1996 by Eberhard Mattes\n"); 271 267 puts ("Usage:"); 272 268 puts (" emxaout [-u] [-o <output_file>] <input_file>"); … … 706 702 ³n External name 707 703 ³1-2 Type index 708 À 704 À 709 705 710 706 Symbol indices are assigned sequentially by EXTDEF and COMDEF. */ … … 936 932 F (bit 7) 1=frame thread, 0=methods F0 through F5 937 933 Frame (bits 4-6) frame thread number (F=1) or frame method (F=0) 938 T (bit 3) 1=target thread, 1=methods 934 T (bit 3) 1=target thread, 1=methods 939 935 P (bit 2) Bit 2 of target method 940 936 Targt (bits 0-1) target thread number (T=1) or target method (T=0) */ … … 945 941 int frame_method, frame_index, target_method, target_index; 946 942 dword disp; 947 struct reloc r;943 struct relocation_info r; 948 944 struct thread th; 949 945 … … 958 954 fix_data = get_byte (); 959 955 if (first & 0x40) 960 r. pcrel = 0;956 r.r_pcrel = 0; 961 957 else 962 r. pcrel = 1;963 r. address = offset + cur_off;964 r. unused = 0;958 r.r_pcrel = 1; 959 r.r_address = offset + cur_off; 960 r.r_pad = 0; 965 961 locat = (first >> 2) & 0x0f; 966 962 if (fix_data & 0x80) … … 1015 1011 error2 ("FIXUPP: OFFSET-16(LR) fixup not supported"); 1016 1012 case 9: 1017 r. length = 2;1013 r.r_length = 2; 1018 1014 break; 1019 1015 case 11: … … 1028 1024 { 1029 1025 case 0: /* T0: SEGDEF */ 1030 r. ext= 0;1026 r.r_extern = 0; 1031 1027 if (target_index == seg_code + 1) 1032 r. symbolnum = N_TEXT;1028 r.r_symbolnum = N_TEXT; 1033 1029 else if (target_index == seg_data + 1) 1034 1030 { 1035 r. symbolnum = N_DATA;1031 r.r_symbolnum = N_DATA; 1036 1032 disp += (seg_code >= 0 ? segments[seg_code].size : 0); 1037 1033 } 1038 1034 else if (target_index == seg_bss + 1) 1039 1035 { 1040 r. symbolnum = N_BSS;1036 r.r_symbolnum = N_BSS; 1041 1037 disp += (seg_code >= 0 ? segments[seg_code].size : 0); 1042 1038 disp += (seg_data >= 0 ? segments[seg_data].size : 0); … … 1050 1046 break; 1051 1047 case 2: /* T2: EXTDEF */ 1052 r. ext= 1;1048 r.r_extern = 1; 1053 1049 if (target_index < 1 || target_index > GROW_COUNT (extdefs)) 1054 1050 error2 ("FIXUPP: EXTDEF index out of range"); 1055 r. symbolnum = target_index - 1;1051 r.r_symbolnum = target_index - 1; 1056 1052 break; 1057 1053 default: … … 1085 1081 abort (); 1086 1082 1087 if (r. address + 4 > segments[cur_seg].size)1083 if (r.r_address + 4 > segments[cur_seg].size) 1088 1084 error2 ("FIXUPP: fixup beyond end of segment"); 1089 *((dword *)(segments[cur_seg].data + r. address))1090 += r. pcrel ? disp - (r.address + 4) : disp;1085 *((dword *)(segments[cur_seg].data + r.r_address)) 1086 += r.r_pcrel ? disp - (r.r_address + 4) : disp; 1091 1087 } 1092 1088 } … … 1127 1123 for (i = 0; i < GROW_COUNT (extdefs); ++i) 1128 1124 { 1129 n. type = N_EXT;1130 n. string= 0;1131 n. value = extdefs[i].size;1132 n. other = 0;1133 n. desc = 0;1125 n.n_type = N_EXT; 1126 n.n_un.n_strx = 0; 1127 n.n_value = extdefs[i].size; 1128 n.n_other = 0; 1129 n.n_desc = 0; 1134 1130 j = GROW_ADD (symbols); 1135 1131 symbols[j].name = xstrdup (extdefs[i].name); … … 1143 1139 skip = TRUE; 1144 1140 else if (pubdefs[i].seg == seg_code + 1) 1145 n. type = N_TEXT | N_EXT;1141 n.n_type = N_TEXT | N_EXT; 1146 1142 else if (pubdefs[i].seg == seg_data + 1) 1147 n. type = N_DATA | N_EXT;1143 n.n_type = N_DATA | N_EXT; 1148 1144 else 1149 1145 skip = TRUE; 1150 1146 if (!skip) 1151 1147 { 1152 n. string= 0;1153 n. value = pubdefs[i].offset;1154 n. other = 0;1155 n. desc = 0;1148 n.n_un.n_strx = 0; 1149 n.n_value = pubdefs[i].offset; 1150 n.n_other = 0; 1151 n.n_desc = 0; 1156 1152 j = GROW_ADD (symbols); 1157 1153 symbols[j].name = xstrdup (pubdefs[i].name); … … 1173 1169 { 1174 1170 if (symbols[i].name == NULL) 1175 symbols[i].n. string= 0;1171 symbols[i].n.n_un.n_strx = 0; 1176 1172 else 1177 1173 { 1178 symbols[i].n. string= str_size;1174 symbols[i].n.n_un.n_strx = str_size; 1179 1175 str_size += strlen (symbols[i].name) + 1; 1180 1176 } … … 1192 1188 static void conv_modend (void) 1193 1189 { 1194 struct a_out_headerh;1190 struct exec h; 1195 1191 int i; 1196 1192 1197 1193 make_symtab (); 1198 h.magic = 0407;1199 h.machtype = 0;1200 h.flags = 0;1201 h. text_size= (seg_code >= 0 ? segments[seg_code].size : 0);1202 h. data_size= (seg_data >= 0 ? segments[seg_data].size : 0);1203 h. bss_size= (seg_bss >= 0 ? segments[seg_bss ].size : 0);1204 h. sym_size= GROW_COUNT (symbols) * sizeof (struct nlist);1205 h. entry = 0;1206 h. trsize = GROW_COUNT (trelocs) * sizeof (struct reloc);1207 h. drsize = GROW_COUNT (drelocs) * sizeof (struct reloc);1194 N_SET_MAGIC (h, OMAGIC); 1195 N_SET_MACHTYPE (h, 0); 1196 N_SET_FLAGS (h, 0); 1197 h.a_text = (seg_code >= 0 ? segments[seg_code].size : 0); 1198 h.a_data = (seg_data >= 0 ? segments[seg_data].size : 0); 1199 h.a_bss = (seg_bss >= 0 ? segments[seg_bss ].size : 0); 1200 h.a_syms = GROW_COUNT (symbols) * sizeof (struct nlist); 1201 h.a_entry = 0; 1202 h.a_trsize = GROW_COUNT (trelocs) * sizeof (struct relocation_info); 1203 h.a_drsize = GROW_COUNT (drelocs) * sizeof (struct relocation_info); 1208 1204 fwrite (&h, sizeof (h), 1, out_file); 1209 1205 if (seg_code >= 0) … … 1212 1208 fwrite (segments[seg_data].data, segments[seg_data].size, 1, out_file); 1213 1209 for (i = 0; i < GROW_COUNT (trelocs); ++i) 1214 fwrite (&trelocs[i], sizeof (struct reloc ), 1, out_file);1210 fwrite (&trelocs[i], sizeof (struct relocation_info), 1, out_file); 1215 1211 for (i = 0; i < GROW_COUNT (drelocs); ++i) 1216 fwrite (&drelocs[i], sizeof (struct reloc ), 1, out_file);1212 fwrite (&drelocs[i], sizeof (struct relocation_info), 1, out_file); 1217 1213 write_symtab (); 1218 1214 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxomf.c
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r235 r236 33 33 #include <ar.h> 34 34 35 /* The version number of this program. This is printed with the usage36 message. */37 38 #define VERSION "0.9d"39 #include "../../../../include/innotekversion.h"40 41 35 /* Insert private header files. */ 42 36 … … 168 162 /* These varibles point to the text and data relocation tables. */ 169 163 170 static const struct reloc *text_rel;171 static const struct reloc *data_rel;164 static const struct relocation_info *text_rel; 165 static const struct relocation_info *data_rel; 172 166 173 167 /* Public variables for communication with stabshll.c. */ … … 345 339 346 340 /* This variable points to the a.out header of the input module. */ 347 static const struct a_out_header*a_out_h;341 static const struct exec *a_out_h; 348 342 349 343 /* This table contains additional information for the a.out symbols. … … 493 487 { 494 488 void *p; 495 489 496 490 p = malloc (n); 497 491 if (p == NULL) … … 508 502 { 509 503 void *p; 510 504 511 505 p = realloc (ptr, n); 512 506 if (p == NULL) … … 523 517 { 524 518 char *p; 525 519 526 520 p = xmalloc (strlen (s) + 1); 527 521 strcpy (p, s); … … 544 538 array pointed to by sym_ptr) is returned. If the symbol is not 545 539 found, NULL is returned. */ 546 547 540 const struct nlist *find_symbol (const char *name) 548 541 { 549 542 int i, j, n, len, t; 550 543 const byte *s; 551 544 552 545 i = 4; len = strlen (name); 553 546 554 547 /* Search the string table for a matching string. */ 555 556 548 while (i < str_size) 557 549 { … … 562 554 if (memcmp (name, str_ptr+i, len+1) == 0) 563 555 { 564 565 556 /* Search the symbol table for an appropriate entry 566 557 referencing the string. */ 567 568 558 n = sym_count; 569 559 for (j = 0; j < n; ++j) 570 if (sym_ptr[j]. string== sym_ofs)560 if (sym_ptr[j].n_un.n_strx == sym_ofs) 571 561 { 572 t = sym_ptr[j]. type & ~N_EXT;562 t = sym_ptr[j].n_type & ~N_EXT; 573 563 if (t == N_TEXT || t == N_DATA || t == N_BSS 574 || (t == 0 && sym_ptr[j]. value != 0))564 || (t == 0 && sym_ptr[j].n_value != 0)) 575 565 return sym_ptr+j; 576 566 } … … 1078 1068 started = FALSE; 1079 1069 for (i = 0; i < sym_count; ++i) 1080 if (sym_ptr[i]. type == (N_INDR|N_EXT))1070 if (sym_ptr[i].n_type == (N_INDR|N_EXT)) 1081 1071 ++i; /* Skip immediately following entry */ 1082 else if (sym_ptr[i]. type == N_EXT && sym_ptr[i].value == 0)1072 else if (sym_ptr[i].n_type == N_EXT && sym_ptr[i].n_value == 0) 1083 1073 { 1084 name = str_ptr + sym_ptr[i]. string;1074 name = str_ptr + sym_ptr[i].n_un.n_strx; 1085 1075 sym_more[i].index = sym_index++; 1086 1076 if (memcmp (name, "_16_", 4) == 0) … … 1088 1078 add_extdef (&started, name); 1089 1079 } 1090 else if (sym_ptr[i]. type == N_WEAKU)1080 else if (sym_ptr[i].n_type == N_WEAKU) 1091 1081 { 1092 1082 if (weak_zero_index == 0) … … 1096 1086 } 1097 1087 sym_more[i].index = sym_index++; 1098 add_extdef (&started, str_ptr + sym_ptr[i]. string);1088 add_extdef (&started, str_ptr + sym_ptr[i].n_un.n_strx); 1099 1089 } 1100 1090 if (started) … … 1118 1108 1119 1109 for (i = 0; i < sym_count; ++i) 1120 if (sym_ptr[i]. type == (N_INDR|N_EXT))1110 if (sym_ptr[i].n_type == (N_INDR|N_EXT)) 1121 1111 ++i; /* Skip immediately following entry */ 1122 else if (sym_ptr[i]. type == N_WEAKU)1112 else if (sym_ptr[i].n_type == N_WEAKU) 1123 1113 { 1124 1114 init_rec (COMENT); … … 1141 1131 int i; 1142 1132 1143 #define SETTYPE(t) ((struct nlist *)sym_ptr)[i]. type = t1133 #define SETTYPE(t) ((struct nlist *)sym_ptr)[i].n_type = t 1144 1134 1145 1135 for (i = 0; i < sym_count; ++i) 1146 if ((sym_ptr[i]. type >= N_WEAKA) && (sym_ptr[i].type <= N_WEAKB))1136 if ((sym_ptr[i].n_type >= N_WEAKA) && (sym_ptr[i].n_type <= N_WEAKB)) 1147 1137 { 1148 const char *name = str_ptr + sym_ptr[i]. string;1138 const char *name = str_ptr + sym_ptr[i].n_un.n_strx; 1149 1139 1150 1140 int public = N_EXT; … … 1161 1151 1162 1152 /* Now convert it to a normal public symbol */ 1163 switch (sym_ptr[i]. type)1153 switch (sym_ptr[i].n_type) 1164 1154 { 1165 1155 case N_WEAKA: SETTYPE (N_ABS | public); break; … … 1169 1159 } 1170 1160 } 1171 else if ((sym_ptr[i]. type & N_EXT) && is_weak (str_ptr + sym_ptr[i].string))1161 else if ((sym_ptr[i].n_type & N_EXT) && is_weak (str_ptr + sym_ptr[i].n_un.n_strx)) 1172 1162 { 1173 1163 /* Convert a external reference to N_WEAKU */ … … 1192 1182 1193 1183 for (i = 0; i < sym_count - 1; ++i) 1194 if (sym_ptr[i]. type == (N_INDR|N_EXT) && sym_ptr[i+1].type == N_EXT)1184 if (sym_ptr[i].n_type == (N_INDR|N_EXT) && sym_ptr[i+1].n_type == N_EXT) 1195 1185 { 1196 1186 init_rec (ALIAS); 1197 put_sym (str_ptr + sym_ptr[i]. string);1198 put_sym (str_ptr + sym_ptr[i+1]. string);1187 put_sym (str_ptr + sym_ptr[i].n_un.n_strx); 1188 put_sym (str_ptr + sym_ptr[i+1].n_un.n_strx); 1199 1189 write_rec (); 1200 1190 1201 1191 if (out_lib != NULL) 1202 1192 { 1203 pub_name = str_ptr + sym_ptr[i]. string;1193 pub_name = str_ptr + sym_ptr[i].n_un.n_strx; 1204 1194 if (strip_underscore (pub_name)) 1205 1195 ++pub_name; … … 1240 1230 started = FALSE; 1241 1231 for (i = 0; i < sym_count; ++i) 1242 if ((sym_ptr[i]. type & ~N_EXT) == type)1232 if ((sym_ptr[i].n_type & ~N_EXT) == type) 1243 1233 { 1244 address = sym_ptr[i]. value - start;1234 address = sym_ptr[i].n_value - start; 1245 1235 if ((address >= 0x10000 || force_big) == big) 1246 1236 { 1247 name = str_ptr + sym_ptr[i]. string;1248 if ((sym_ptr[i]. type & N_EXT)1237 name = str_ptr + sym_ptr[i].n_un.n_strx; 1238 if ((sym_ptr[i].n_type & N_EXT) 1249 1239 || (type == N_TEXT && strncmp (name, "___POST$", 8) == 0)) 1250 1240 { 1251 if ((sym_ptr[i]. type & N_EXT) && out_lib != NULL)1241 if ((sym_ptr[i].n_type & N_EXT) && out_lib != NULL) 1252 1242 { 1253 1243 pub_name = name; … … 1329 1319 started = FALSE; 1330 1320 for (i = 0; i < sym_count; ++i) 1331 if (sym_ptr[i]. type == (N_INDR|N_EXT))1321 if (sym_ptr[i].n_type == (N_INDR|N_EXT)) 1332 1322 ++i; /* Skip immediately following entry */ 1333 else if (sym_ptr[i]. type == N_EXT && sym_ptr[i].value != 0)1323 else if (sym_ptr[i].n_type == N_EXT && sym_ptr[i].n_value != 0) 1334 1324 { 1335 name = str_ptr + sym_ptr[i]. string;1325 name = str_ptr + sym_ptr[i].n_un.n_strx; 1336 1326 sym_more[i].index = sym_index++; 1337 1327 if (memcmp (name, "_16_", 4) == 0) 1338 1328 sym_more[i].flags |= SF_FAR16; 1339 size = sym_ptr[i]. value;1329 size = sym_ptr[i].n_value; 1340 1330 if (started && !fits (strlen (name) + 12)) 1341 1331 { … … 1397 1387 P (bit 0) USE32 */ 1398 1388 1399 static int seg_def (int name_index, int class_index, long size, int stack , int fAlign4B)1389 static int seg_def (int name_index, int class_index, long size, int stack) 1400 1390 { 1401 1391 byte seg_attr; 1402 1392 1403 seg_attr = (fAlign4B ? (stack ? 0xb5 : 0xa9) : (stack ? 0x75 : 0x69));1393 seg_attr = (stack ? 0x75 : 0x69); 1404 1394 if (size > 0x10000 || force_big) 1405 1395 { … … 1436 1426 dword a1, a2; 1437 1427 1438 a1 = ((struct reloc *)x1)->address;1439 a2 = ((struct reloc *)x2)->address;1428 a1 = ((struct relocation_info *)x1)->r_address; 1429 a2 = ((struct relocation_info *)x2)->r_address; 1440 1430 if (a1 < a2) 1441 1431 return -1; … … 1452 1442 SRC points to the data to be written (will be modified for 1453 1443 fixups!), SEG_SIZE is the number of bytes to be written. REL 1454 points to the relocation table (an array of struct reloc ), REL_SIZE1444 points to the relocation table (an array of struct relocation_info), REL_SIZE 1455 1445 is the size of the relocation table, in bytes(!). SST_FLAG is TRUE 1456 1446 when writing the symbol segment $$SYMBOLS. BOUNDARY points to an … … 1509 1499 F (bit 7) 1=frame thread, 0=methods F0 through F5 1510 1500 Frame (bits 4-6) frame thread number (F=1) or frame method (F=0) 1511 T (bit 3) 1=target thread, 1=methods 1501 T (bit 3) 1=target thread, 1=methods 1512 1502 P (bit 2) Bit 2 of target method 1513 1503 Targt (bits 0-1) target thread number (T=1) or target method (T=0) */ 1514 1504 1515 1505 static void write_seg (int index, int seg_name, byte *src, long seg_size, 1516 const struct reloc *rel, long rel_size, int sst_flag,1506 const struct relocation_info *rel, long rel_size, int sst_flag, 1517 1507 const int *boundary, int boundary_count, int seg_type) 1518 1508 { … … 1520 1510 int i, reloc_count, reloc_idx, target_index, ok, data_off, far16; 1521 1511 int boundary_idx, started, *threadp; 1522 struct reloc *reloc_tab;1523 const struct reloc *r;1512 struct relocation_info *reloc_tab; 1513 const struct relocation_info *r; 1524 1514 byte locat; 1525 1515 dword start_data, start_bss; … … 1529 1519 /* Copy and sort the relocation table. */ 1530 1520 1531 reloc_count = rel_size / sizeof (struct reloc );1532 reloc_tab = xmalloc (reloc_count * sizeof (struct reloc ));1533 memcpy (reloc_tab, rel, reloc_count * sizeof (struct reloc ));1534 qsort (reloc_tab, reloc_count, sizeof (struct reloc ), reloc_compare);1521 reloc_count = rel_size / sizeof (struct relocation_info); 1522 reloc_tab = xmalloc (reloc_count * sizeof (struct relocation_info)); 1523 memcpy (reloc_tab, rel, reloc_count * sizeof (struct relocation_info)); 1524 qsort (reloc_tab, reloc_count, sizeof (struct relocation_info), reloc_compare); 1535 1525 1536 1526 /* First pass: apply fixups to data. Adjust fixup frames for OMF … … 1545 1535 1546 1536 for (i = 0, r = reloc_tab; i < reloc_count; ++i, ++r) 1547 if (r-> length == 2)1537 if (r->r_length == 2) 1548 1538 { 1549 1539 1550 1540 /* Here we have a 32-bit relocation. */ 1551 1541 1552 if (r-> ext)1542 if (r->r_extern) 1553 1543 { 1554 1544 … … 1557 1547 address. */ 1558 1548 1559 switch (sym_ptr[r-> symbolnum].type)1549 switch (sym_ptr[r->r_symbolnum].n_type) 1560 1550 { 1561 1551 case N_EXT: 1562 1552 case N_WEAKU: 1563 if (r-> pcrel)1564 *(dword *)(src + r-> address) = 0;1553 if (r->r_pcrel) 1554 *(dword *)(src + r->r_address) = 0; 1565 1555 break; 1566 1556 case N_TEXT: 1567 1557 break; 1568 1558 case N_TEXT|N_EXT: 1569 *(dword *)(src + r-> address) = 0;1559 *(dword *)(src + r->r_address) = 0; 1570 1560 break; 1571 1561 case N_DATA: 1572 1562 case N_DATA|N_EXT: 1573 *(dword *)(src + r-> address) -= start_data;1563 *(dword *)(src + r->r_address) -= start_data; 1574 1564 break; 1575 1565 case N_BSS: 1576 1566 case N_BSS|N_EXT: 1577 *(dword *)(src + r-> address) -= start_bss;1567 *(dword *)(src + r->r_address) -= start_bss; 1578 1568 break; 1579 1569 default: 1580 1570 error ("write_seg: Invalid symbol type (0x%.2x)", 1581 sym_ptr[r-> symbolnum].type);1571 sym_ptr[r->r_symbolnum].n_type); 1582 1572 } 1583 1573 } 1584 else if (!(r-> pcrel && (r->symbolnum & ~N_EXT) == seg_type))1574 else if (!(r->r_pcrel && (r->r_symbolnum & ~N_EXT) == seg_type)) 1585 1575 { 1586 1576 … … 1589 1579 relocation table. */ 1590 1580 1591 switch (r-> symbolnum & ~N_EXT)1581 switch (r->r_symbolnum & ~N_EXT) 1592 1582 { 1593 1583 case N_TEXT: 1594 1584 break; 1595 1585 case N_DATA: 1596 *(dword *)(src + r-> address) -= start_data;1586 *(dword *)(src + r->r_address) -= start_data; 1597 1587 break; 1598 1588 case N_BSS: 1599 *(dword *)(src + r-> address) -= start_bss;1589 *(dword *)(src + r->r_address) -= start_bss; 1600 1590 break; 1601 1591 default: … … 1628 1618 1629 1619 i = reloc_idx; end = off + n; 1630 while (i < reloc_count && reloc_tab[i]. address < end)1620 while (i < reloc_count && reloc_tab[i].r_address < end) 1631 1621 ++i; 1632 1622 if (i > reloc_idx) 1633 1623 { 1634 1624 --i; 1635 tmp = reloc_tab[i]. address + (1 << reloc_tab[i].length) - off;1625 tmp = reloc_tab[i].r_address + (1 << reloc_tab[i].r_length) - off; 1636 1626 if (tmp > n) 1637 n = reloc_tab[i]. address - off;1627 n = reloc_tab[i].r_address - off; 1638 1628 } 1639 1629 … … 1680 1670 current LEDATA chunk. */ 1681 1671 1682 while (reloc_idx < reloc_count && r-> address < end)1672 while (reloc_idx < reloc_count && r->r_address < end) 1683 1673 { 1684 1674 … … 1689 1679 16:16 fixups. */ 1690 1680 1691 ok = (r-> length == 2 || (sst_flag && r->length == 1));1681 ok = (r->r_length == 2 || (sst_flag && r->r_length == 1)); 1692 1682 far16 = FALSE; 1693 1683 1694 if (r-> ext)1684 if (r->r_extern) 1695 1685 { 1696 1686 … … 1700 1690 1701 1691 threadp = NULL; 1702 if (sym_more[r-> symbolnum].flags & SF_FAR16)1692 if (sym_more[r->r_symbolnum].flags & SF_FAR16) 1703 1693 far16 = TRUE; 1704 1694 } 1705 else if (r-> pcrel && (r->symbolnum & ~N_EXT) == seg_type)1695 else if (r->r_pcrel && (r->r_symbolnum & ~N_EXT) == seg_type) 1706 1696 { 1707 1697 ok = FALSE; … … 1717 1707 target_index is the OMF segment index. */ 1718 1708 1719 switch (r-> symbolnum & ~N_EXT)1709 switch (r->r_symbolnum & ~N_EXT) 1720 1710 { 1721 1711 case N_TEXT: … … 1782 1772 /* Compute and write the locat word. */ 1783 1773 1784 data_off = r-> address - off;1774 data_off = r->r_address - off; 1785 1775 if (far16) 1786 1776 locat = 0x8c; /* Method 3: 16:16 far pointer */ 1787 else if (sst_flag && r-> length == 1)1777 else if (sst_flag && r->r_length == 1) 1788 1778 locat = 0x88; /* Method 2: selector */ 1789 1779 else 1790 1780 locat = 0xa4; /* Method 9: 32-bit offset */ 1791 1781 locat |= ((data_off >> 8) & 0x03); 1792 if (!r-> pcrel)1782 if (!r->r_pcrel) 1793 1783 locat |= 0x40; 1794 1784 put_8 (locat); … … 1801 1791 /* F=0, FRAME=F2, T=0, P=1, TARGT=T2 */ 1802 1792 put_8 (0x26); 1803 put_idx (sym_more[r-> symbolnum].index);1804 put_idx (sym_more[r-> symbolnum].index);1793 put_idx (sym_more[r->r_symbolnum].index); 1794 put_idx (sym_more[r->r_symbolnum].index); 1805 1795 } 1806 else if (r-> ext)1796 else if (r->r_extern) 1807 1797 { 1808 1798 /* F=1, FRAME=F1, T=0, P=1, TARGT=T2 */ 1809 1799 put_8 (0x86 | (flat_thread << 4)); 1810 put_idx (sym_more[r-> symbolnum].index);1800 put_idx (sym_more[r->r_symbolnum].index); 1811 1801 } 1812 1802 else … … 1910 1900 for (i = 0; i < sym_count; ++i) 1911 1901 { 1912 type = sym_ptr[i]. type & ~N_EXT;1913 if ((type == N_SETA && sym_ptr[i]. value == 0xffffffff)1902 type = sym_ptr[i].n_type & ~N_EXT; 1903 if ((type == N_SETA && sym_ptr[i].n_value == 0xffffffff) 1914 1904 || type == N_SETT || type == N_SETD) 1915 1905 { … … 1920 1910 this set is already known. */ 1921 1911 1922 name = str_ptr + sym_ptr[i]. string;1912 name = str_ptr + sym_ptr[i].n_un.n_strx; 1923 1913 for (set_ptr = sets; set_ptr != NULL; set_ptr = set_ptr->next) 1924 1914 if (strcmp (set_ptr->name, name) == 0) … … 1959 1949 set_ptr->data = xrealloc (set_ptr->data, set_ptr->count * 4); 1960 1950 set_ptr->seg = xrealloc (set_ptr->seg, set_ptr->count); 1961 set_ptr->data[set_ptr->count-1] = sym_ptr[i]. value;1951 set_ptr->data[set_ptr->count-1] = sym_ptr[i].n_value; 1962 1952 set_ptr->seg[set_ptr->count-1] 1963 1953 = (type == N_SETT ? N_TEXT : N_DATA); … … 2010 2000 set_ptr->seg_index[j] = 2011 2001 seg_def (set_ptr->seg_name[j], code_class_name, 2012 4 * (j == 1 ? set_ptr->count : set_ptr->def), FALSE , TRUE);2002 4 * (j == 1 ? set_ptr->count : set_ptr->def), FALSE); 2013 2003 } 2014 2004 … … 2094 2084 int i, max_count; 2095 2085 dword *buf; 2096 struct reloc *reloc_tab;2086 struct relocation_info *reloc_tab; 2097 2087 2098 2088 max_count = 0; buf = NULL; reloc_tab = NULL; … … 2126 2116 memset (buf, 0, 4 * max_count); 2127 2117 reloc_tab = xrealloc (reloc_tab, 2128 max_count * sizeof (struct reloc ));2118 max_count * sizeof (struct relocation_info)); 2129 2119 } 2130 2120 … … 2135 2125 { 2136 2126 buf[i] = set_ptr->data[i]; 2137 reloc_tab[i]. address = i * 4;2138 reloc_tab[i]. symbolnum = set_ptr->seg[i];2139 reloc_tab[i]. pcrel = 0;2140 reloc_tab[i]. length = 2;2141 reloc_tab[i]. ext= 0;2142 reloc_tab[i]. unused = 0;2127 reloc_tab[i].r_address = i * 4; 2128 reloc_tab[i].r_symbolnum = set_ptr->seg[i]; 2129 reloc_tab[i].r_pcrel = 0; 2130 reloc_tab[i].r_length = 2; 2131 reloc_tab[i].r_extern = 0; 2132 reloc_tab[i].r_pad = 0; 2143 2133 } 2144 2134 … … 2147 2137 write_seg (set_ptr->seg_index[1], set_ptr->seg_name[1], 2148 2138 (byte *)buf, set_ptr->count * 4, reloc_tab, 2149 set_ptr->count * sizeof (struct reloc ), FALSE, NULL, 0,2139 set_ptr->count * sizeof (struct relocation_info), FALSE, NULL, 0, 2150 2140 -1); 2151 2141 } … … 2168 2158 /* Find a relocation table entry by fixup address. */ 2169 2159 2170 static const struct reloc *find_reloc_fixup (const struct reloc*rel,2160 static const struct relocation_info *find_reloc_fixup (const struct relocation_info *rel, 2171 2161 long rel_size, dword addr) 2172 2162 { 2173 2163 int i, count; 2174 2164 2175 count = rel_size / sizeof (struct reloc );2165 count = rel_size / sizeof (struct relocation_info); 2176 2166 for (i = 0; i < count; ++i) 2177 if (rel[i]. address == addr)2167 if (rel[i].r_address == addr) 2178 2168 return &rel[i]; 2179 2169 return NULL; … … 2201 2191 successful, FALSE on failure. */ 2202 2192 2203 static int fetch_modstr (const struct reloc *rel, dword addr,2193 static int fetch_modstr (const struct relocation_info *rel, dword addr, 2204 2194 char *dst, size_t dst_size) 2205 2195 { … … 2208 2198 2209 2199 if (rel == NULL) return FALSE; 2210 if (rel-> ext)2200 if (rel->r_extern) 2211 2201 { 2212 2202 struct modstr *p; … … 2214 2204 const char *sym_name; 2215 2205 const struct nlist *m_sym = NULL; 2216 const struct a_out_header*m_ao = NULL;2206 const struct exec *m_ao = NULL; 2217 2207 2218 2208 /* We have to take the string from another module. First try to 2219 2209 get the string from the cache. */ 2220 2210 2221 sym_name = str_ptr + sym_ptr[rel-> symbolnum].string;2211 sym_name = str_ptr + sym_ptr[rel->r_symbolnum].n_un.n_strx; 2222 2212 for (p = modstr_cache; p != NULL; p = p->next) 2223 2213 if (strcmp (p->symbol, sym_name) == 0) … … 2253 2243 if (ferror (inp_file)) 2254 2244 error ("Cannot read `%s'", inp_fname); 2255 m_ao = (const struct a_out_header*)buf;2256 if (size < sizeof (struct a_out_header) || m_ao->magic != 0407)2245 m_ao = (const struct exec *)buf; 2246 if (size < sizeof (struct exec) || N_MAGIC(*m_ao) != OMAGIC) 2257 2247 break; 2258 t = buf + sizeof (struct a_out_header);2259 t += m_ao-> text_size; t += m_ao->data_size;2260 t += m_ao-> trsize; t += m_ao->drsize;2261 m_sym = (const struct nlist *)t; t += m_ao-> sym_size;2248 t = buf + sizeof (struct exec); 2249 t += m_ao->a_text; t += m_ao->a_data; 2250 t += m_ao->a_trsize; t += m_ao->a_drsize; 2251 m_sym = (const struct nlist *)t; t += m_ao->a_syms; 2262 2252 m_str = t; 2263 2253 if (m_str + 4 - buf > size) 2264 2254 break; 2265 2255 m_str_size = *(long *)m_str; 2266 m_sym_count = m_ao-> sym_size/ sizeof (struct nlist);2256 m_sym_count = m_ao->a_syms / sizeof (struct nlist); 2267 2257 if (m_str + m_str_size - buf > size) 2268 2258 break; 2269 2259 for (i = 0; i < m_sym_count; ++i) 2270 switch (m_sym[i]. type)2260 switch (m_sym[i].n_type) 2271 2261 { 2272 2262 case N_TEXT|N_EXT: 2273 2263 case N_DATA|N_EXT: 2274 if (strcmp (m_str + m_sym[i]. string, sym_name) == 0)2264 if (strcmp (m_str + m_sym[i].n_un.n_strx, sym_name) == 0) 2275 2265 { 2276 2266 m_sym += i; found = TRUE; break; … … 2283 2273 error ("Symbol `%s' not found", sym_name); 2284 2274 2285 addr = m_sym-> value;2286 switch (m_sym-> type)2275 addr = m_sym->n_value; 2276 switch (m_sym->n_type) 2287 2277 { 2288 2278 case N_TEXT|N_EXT: 2289 seg_ptr = buf + sizeof (struct a_out_header);2290 seg_size = m_ao-> text_size;2279 seg_ptr = buf + sizeof (struct exec); 2280 seg_size = m_ao->a_text; 2291 2281 break; 2292 2282 case N_DATA|N_EXT: 2293 seg_ptr = buf + sizeof (struct a_out_header) + m_ao->text_size;2294 seg_size = m_ao-> data_size;2283 seg_ptr = buf + sizeof (struct exec) + m_ao->a_text; 2284 seg_size = m_ao->a_data; 2295 2285 break; 2296 2286 default: … … 2325 2315 dword si; 2326 2316 2327 switch (rel-> symbolnum)2317 switch (rel->r_symbolnum) 2328 2318 { 2329 2319 case N_TEXT: … … 2402 2392 name1 = NULL; name2 = NULL; 2403 2393 for (i = 0; i < sym_count; ++i) 2404 switch (sym_ptr[i]. type)2394 switch (sym_ptr[i].n_type) 2405 2395 { 2406 2396 case N_IMP1|N_EXT: 2407 name1 = str_ptr + sym_ptr[i]. string;2397 name1 = str_ptr + sym_ptr[i].n_un.n_strx; 2408 2398 break; 2409 2399 case N_IMP2|N_EXT: 2410 name2 = str_ptr + sym_ptr[i]. string;2400 name2 = str_ptr + sym_ptr[i].n_un.n_strx; 2411 2401 break; 2412 2402 default: … … 2473 2463 long table_off, ord, off; 2474 2464 long *table; 2475 const struct reloc *rel;2465 const struct relocation_info *rel; 2476 2466 2477 2467 /* There must be exactly one public symbol (which must defined for … … 2481 2471 pub_name = NULL; table_off = -1; 2482 2472 for (i = 0; i < sym_count; ++i) 2483 switch (sym_ptr[i]. type)2473 switch (sym_ptr[i].n_type) 2484 2474 { 2485 2475 case N_TEXT|N_EXT: 2486 2476 if (pub_name != NULL) return FALSE; 2487 pub_name = str_ptr + sym_ptr[i]. string;2477 pub_name = str_ptr + sym_ptr[i].n_un.n_strx; 2488 2478 break; 2489 2479 … … 2493 2483 2494 2484 case N_SETT|N_EXT: 2495 if (strcmp (str_ptr + sym_ptr[i]. string, "__os2dll") != 0)2485 if (strcmp (str_ptr + sym_ptr[i].n_un.n_strx, "__os2dll") != 0) 2496 2486 return FALSE; 2497 table_off = sym_ptr[i]. value;2487 table_off = sym_ptr[i].n_value; 2498 2488 break; 2499 2489 } … … 2516 2506 /* Check and fetch the procedure name. */ 2517 2507 2518 rel = find_reloc_fixup (text_rel, a_out_h-> trsize, table_off + 3 * 4);2508 rel = find_reloc_fixup (text_rel, a_out_h->a_trsize, table_off + 3 * 4); 2519 2509 if (!fetch_modstr (rel, table[3], proc_name, sizeof (proc_name))) 2520 2510 error ("Invalid import table: invalid pointer to procedure name"); … … 2539 2529 /* Check and fetch the module name. */ 2540 2530 2541 rel = find_reloc_fixup (text_rel, a_out_h-> trsize, table_off + 2 * 4);2531 rel = find_reloc_fixup (text_rel, a_out_h->a_trsize, table_off + 2 * 4); 2542 2532 if (!fetch_modstr (rel, table[2], dll_name, sizeof (dll_name))) 2543 2533 error ("Invalid import table: invalid pointer to module name"); … … 2574 2564 ok = FALSE; 2575 2565 for (i = 0; i < sym_count; ++i) 2576 if (sym_ptr[i]. type == N_SO)2566 if (sym_ptr[i].n_type == N_SO) 2577 2567 { 2578 p1 = str_ptr + sym_ptr[i]. string;2568 p1 = str_ptr + sym_ptr[i].n_un.n_strx; 2579 2569 len = strlen (p1); 2580 2570 if (len > 0 && p1[len-1] != '/') … … 2710 2700 2711 2701 for (i = 0; i < sym_count; ++i) 2712 switch (sym_ptr[i]. type)2702 switch (sym_ptr[i].n_type) 2713 2703 { 2714 2704 case N_SOL: 2715 file_index = file_find (str_ptr + sym_ptr[i]. string);2705 file_index = file_find (str_ptr + sym_ptr[i].n_un.n_strx); 2716 2706 break; 2717 2707 case N_SLINE: 2718 2708 grow_by (&line_grow, 1); 2719 2709 line_list[line_grow.count].file_index = file_index; 2720 line_list[line_grow.count].line = sym_ptr[i]. desc;2721 line_list[line_grow.count].addr = sym_ptr[i]. value;2710 line_list[line_grow.count].line = sym_ptr[i].n_desc; 2711 line_list[line_grow.count].addr = sym_ptr[i].n_value; 2722 2712 ++line_grow.count; 2723 2713 } … … 2841 2831 2842 2832 for (i = 0; i < sym_count; ++i) 2843 switch (sym_ptr[i]. type)2833 switch (sym_ptr[i].n_type) 2844 2834 { 2845 2835 case 0: case 0 |N_EXT: … … 2874 2864 default: 2875 2865 fprintf (stderr, "Unknown symbol table entry: 0x%.2x \"%s\"\n", 2876 sym_ptr[i]. type, str_ptr + sym_ptr[i].string);2866 sym_ptr[i].n_type, str_ptr + sym_ptr[i].n_un.n_strx); 2877 2867 break; 2878 2868 } … … 2899 2889 memory. */ 2900 2890 2901 a_out_h = (struct a_out_header*)inp_buf;2902 if (size < sizeof (struct a_out_header) || a_out_h->magic != 0407)2891 a_out_h = (struct exec *)inp_buf; 2892 if (size < sizeof (struct exec) || N_MAGIC(*a_out_h) != OMAGIC) 2903 2893 error ("Input file `%s' is not an a.out file", error_fname); 2904 text_size = a_out_h-> text_size;2905 data_size = a_out_h-> data_size;2906 t = inp_buf + sizeof (struct a_out_header);2894 text_size = a_out_h->a_text; 2895 data_size = a_out_h->a_data; 2896 t = inp_buf + sizeof (struct exec); 2907 2897 text_ptr = t; t += text_size; 2908 2898 data_ptr = t; t += data_size; 2909 text_rel = (const struct reloc *)t; t += a_out_h->trsize;2910 data_rel = (const struct reloc *)t; t += a_out_h->drsize;2911 sym_ptr = (const struct nlist *)t; t += a_out_h-> sym_size;2899 text_rel = (const struct relocation_info *)t; t += a_out_h->a_trsize; 2900 data_rel = (const struct relocation_info *)t; t += a_out_h->a_drsize; 2901 sym_ptr = (const struct nlist *)t; t += a_out_h->a_syms; 2912 2902 str_ptr = t; 2913 if (a_out_h-> sym_size== 0)2903 if (a_out_h->a_syms == 0) 2914 2904 str_size = 0; 2915 2905 else … … 2919 2909 str_size = *(long *)str_ptr; 2920 2910 } 2921 sym_count = a_out_h-> sym_size/ sizeof (struct nlist);2911 sym_count = a_out_h->a_syms / sizeof (struct nlist); 2922 2912 if (str_ptr + str_size - inp_buf > size) 2923 2913 goto invalid; … … 2944 2934 if (entry_symbol == NULL) 2945 2935 error ("Entry symbol not found"); 2946 if ((entry_symbol-> type & ~N_EXT) != N_TEXT)2936 if ((entry_symbol->n_type & ~N_EXT) != N_TEXT) 2947 2937 error ("Entry symbol not in text segment"); 2948 2938 } … … 3028 3018 3029 3019 text_index = seg_def (text_seg_name, code_class_name, text_size, 3030 FALSE , FALSE);3020 FALSE); 3031 3021 write_set_segs (); 3032 3022 3033 3023 if (udat_seg_string != NULL) 3034 3024 udat_index = seg_def (udat_seg_name, data_class_name, data_size, 3035 FALSE , FALSE);3025 FALSE); 3036 3026 data_index = seg_def (data_seg_name, data_class_name, 3037 3027 (udat_seg_string == NULL ? data_size : 0), 3038 FALSE , FALSE);3028 FALSE); 3039 3029 if (udat_seg_string == NULL) 3040 3030 udat_index = data_index; 3041 3031 3042 bss_index = seg_def (bss_seg_name, bss_class_name, a_out_h-> bss_size,3043 FALSE , FALSE);3032 bss_index = seg_def (bss_seg_name, bss_class_name, a_out_h->a_bss, 3033 FALSE); 3044 3034 3045 3035 if (mod_type == MT_MAIN) 3046 stack_index = seg_def (stack_seg_name, stack_class_name, 0x8000, TRUE , FALSE);3036 stack_index = seg_def (stack_seg_name, stack_class_name, 0x8000, TRUE); 3047 3037 3048 3038 if (!strip_symbols) … … 3050 3040 convert_debug (); /* After seg_def of text, data & bss */ 3051 3041 symbols_index = seg_def (symbols_seg_name, debsym_class_name, 3052 sst.size, FALSE , FALSE);3042 sst.size, FALSE); 3053 3043 types_index = seg_def (types_seg_name, debtyp_class_name, 3054 tt.size, FALSE , FALSE);3044 tt.size, FALSE); 3055 3045 } 3056 3046 … … 3095 3085 3096 3086 write_seg (text_index, text_seg_name, text_ptr, text_size, 3097 text_rel, a_out_h-> trsize, FALSE, NULL, 0, N_TEXT);3087 text_rel, a_out_h->a_trsize, FALSE, NULL, 0, N_TEXT); 3098 3088 write_seg (udat_index, udat_seg_name, data_ptr, data_size, 3099 data_rel, a_out_h-> drsize, FALSE, NULL, 0, N_DATA);3089 data_rel, a_out_h->a_drsize, FALSE, NULL, 0, N_DATA); 3100 3090 3101 3091 write_set_data (); … … 3106 3096 tt_boundary, tt_boundary_grow.count, -1); 3107 3097 write_seg (symbols_index, symbols_seg_name, sst.buf, sst.size, 3108 (const struct reloc *)sst_reloc.buf, sst_reloc.size, TRUE,3098 (const struct relocation_info *)sst_reloc.buf, sst_reloc.size, TRUE, 3109 3099 sst_boundary, sst_boundary_grow.count, -1); 3110 3100 write_linnum (); … … 3119 3109 put_8 (0x50); /* ENDDAT: F5, T0 */ 3120 3110 put_idx (text_index); 3121 put_32 (entry_symbol-> value);3111 put_32 (entry_symbol->n_value); 3122 3112 } 3123 3113 else … … 3149 3139 static void usage (void) 3150 3140 { 3151 puts ("emxomf " VERSION INNOTEK_VERSION" -- Copyright (c) 1992-1995 by Eberhard Mattes\n");3141 puts ("emxomf " VERSION " -- Copyright (c) 1992-1995 by Eberhard Mattes\n"); 3152 3142 puts ("Usage:"); 3153 3143 puts (" emxomf [-dgqs] [-l[<symbol>]] [-m <symbol>] [-p <page_size>]"); … … 3399 3389 } 3400 3390 } 3401 3391 3402 3392 /* Ignore the __.SYMDEF and __.IMPORT members. Ignore 3403 3393 import modules unless creating a library file. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxomf.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 19 19 Boston, MA 02111-1307, USA. */ 20 20 21 22 #include "a_out.h" 23 #include "a_out_stab.h" 21 24 22 25 /* These functions are defined in emxomf.c. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxomf.smak
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 7 7 .TKIND := $(TOOLFMT) 8 8 .TSRC := $(addprefix src/emxomf/,emxomf.c stabshll.c grow.c) 9 .TCF := $(CFLAGS.DEF.VERSION) 9 10 .TDEP := @O@omflib$A 10 11 include mkexe.smak … … 13 14 .TKIND := $(TOOLFMT) 14 15 .TSRC := src/emxomf/emxomfar.c 16 .TCF := $(CFLAGS.DEF.VERSION) 15 17 .TDEP := @O@omflib$A 16 18 include mkexe.smak … … 19 21 .TKIND := $(TOOLFMT) 20 22 .TSRC := src/emxomf/emxomfld.c 21 .TDEP := @O@moddef$A 23 .TCF := $(CFLAGS.DEF.VERSION) 24 .TDEP := @O@moddef$A @O@os2$A 22 25 include mkexe.smak 23 26 … … 25 28 .TKIND := $(TOOLFMT) 26 29 .TSRC := $(addprefix src/emxomf/,emxaout.c grow.c) 30 .TCF := $(CFLAGS.DEF.VERSION) 27 31 include mkexe.smak 28 32 … … 30 34 .TKIND := $(TOOLFMT) 31 35 .TSRC := src/emxomf/listomf.c 36 .TCF := $(CFLAGS.DEF.VERSION) 32 37 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxomfar.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 24 24 #include <string.h> 25 25 #include <io.h> 26 27 #define VERSION "0.9d"28 #include "../../../../include/innotekversion.h"29 30 typedef unsigned char byte;31 typedef unsigned short word;32 33 26 #include <sys/omflib.h> 34 27 … … 62 55 static void usage (void) 63 56 { 64 fprintf (stderr, "emxomfar " VERSION INNOTEK_VERSION" -- "57 fprintf (stderr, "emxomfar " VERSION " -- " 65 58 "Copyright (c) 1992-1996 by Eberhard Mattes\n\n"); 66 59 fprintf (stderr, "Usage: emxomfar [-p#] <command> <library_file> [<module>]...\n"); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/emxomfld.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r235 r236 36 36 #include "defs.h" 37 37 38 #define VERSION "0.9d"39 #include "../../../../include/innotekversion.h"40 41 38 #define FALSE 0 42 39 #define TRUE 1 … … 158 155 static void usage (void) 159 156 { 160 fprintf (stderr, "emxomfld " VERSION INNOTEK_VERSION" -- "157 fprintf (stderr, "emxomfld " VERSION " -- " 161 158 "Copyright (c) 1992-1996 by Eberhard Mattes\n\n"); 162 159 fprintf (stderr, -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/listomf.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 27 27 #endif /* __EMX__ */ 28 28 #include <getopt.h> 29 #include <sys/omflib.h> 29 30 #include "defs.h" 30 31 #define VERSION "0.9d"32 #include "../../../../include/innotekversion.h"33 31 34 32 #pragma pack(1) … … 2339 2337 static void usage (void) 2340 2338 { 2341 fputs ("listomf " VERSION INNOTEK_VERSION" -- "2339 fputs ("listomf " VERSION " -- " 2342 2340 "Copyright (c) 1993-1996 by Eberhard Mattes\n\n" 2343 2341 "Usage: listomf [-a] [-d] <input_file>\n\n" -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxomf/stabshll.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 515 515 int sym_seg, int ext) 516 516 { 517 struct reloc r;517 struct relocation_info r; 518 518 519 519 sst_start (SST_static); 520 r. address = sst.size;520 r.r_address = sst.size; 521 521 buffer_dword (&sst, addr); /* Segment offset */ 522 522 buffer_word (&sst, 0); /* Segment address */ … … 524 524 buffer_nstr (&sst, name); /* Symbol name */ 525 525 sst_end (); 526 r. ext= ext;527 r. length = 2;528 r. symbolnum = sym_seg;529 r. pcrel = 0;530 r. unused = 0;526 r.r_extern = ext; 527 r.r_length = 2; 528 r.r_symbolnum = sym_seg; 529 r.r_pcrel = 0; 530 r.r_pad = 0; 531 531 buffer_mem (&sst_reloc, &r, sizeof (r)); 532 r. address += 4;533 r. length = 1;532 r.r_address += 4; 533 r.r_length = 1; 534 534 buffer_mem (&sst_reloc, &r, sizeof (r)); 535 535 } … … 772 772 773 773 774 #if defined ( DEBUG)774 #if defined (HLL_DEBUG) 775 775 776 776 /* This function is used to print an internal type for debugging. */ … … 819 819 printf ("("); 820 820 show_type (tp->d.array.etype); 821 printf ("[% d]", tp->d.array.last + 1 - tp->d.array.first);821 printf ("[%ld]", tp->d.array.last + 1 - tp->d.array.first); 822 822 break; 823 823 case ty_bits: … … 2339 2339 for (i = *index; i < sym_count; ++i) 2340 2340 { 2341 p = str_ptr + sym_ptr[i]. string;2341 p = str_ptr + sym_ptr[i].n_un.n_strx; 2342 2342 n = strlen (p); 2343 2343 if (n > 0 && p[n-1] == '\\') … … 2351 2351 if (i == *index) 2352 2352 { 2353 *str = str_ptr + sym_ptr[i]. string;2353 *str = str_ptr + sym_ptr[i].n_un.n_strx; 2354 2354 return FALSE; 2355 2355 } … … 2360 2360 for (i = *index; i < sym_count; ++i) 2361 2361 { 2362 p = str_ptr + sym_ptr[i]. string;2362 p = str_ptr + sym_ptr[i].n_un.n_strx; 2363 2363 n = strlen (p); 2364 2364 if (n > 0 && p[n-1] == '\\') … … 2401 2401 memcpy (name, str, n); 2402 2402 name[n] = 0; 2403 #if defined ( DEBUG)2403 #if defined (HLL_DEBUG) 2404 2404 printf ("LSYM/LCSYM/GSYM/PSYM/RSYM/STSYM/FUN %s\n", str); 2405 2405 #endif … … 2421 2421 ++parse_ptr; /* synonymous type */ 2422 2422 t = parse_complete_type (name); 2423 #if defined ( DEBUG)2423 #if defined (HLL_DEBUG) 2424 2424 printf (" type: "); 2425 2425 show_type (t); … … 2435 2435 ++parse_ptr; 2436 2436 t = parse_complete_type (name); 2437 #if defined ( DEBUG)2437 #if defined (HLL_DEBUG) 2438 2438 printf (" type: "); 2439 2439 show_type (t); … … 2445 2445 case '5': case '6': case '7': case '8': case '9': 2446 2446 t = parse_complete_type (name); 2447 #if defined ( DEBUG)2447 #if defined (HLL_DEBUG) 2448 2448 printf (" type: "); 2449 2449 show_type (t); … … 2464 2464 { 2465 2465 size_t ptr; 2466 struct reloc r;2466 struct relocation_info r; 2467 2467 2468 2468 sst_start (SST_begin); 2469 r. address = sst.size;2469 r.r_address = sst.size; 2470 2470 ptr = sst.size; 2471 2471 buffer_dword (&sst, addr); /* Segment offset */ … … 2476 2476 sst_end (); 2477 2477 2478 r. ext= 0;2479 r. length = 2;2480 r. symbolnum = N_TEXT;2481 r. pcrel = 0;2482 r. unused = 0;2478 r.r_extern = 0; 2479 r.r_length = 2; 2480 r.r_symbolnum = N_TEXT; 2481 r.r_pcrel = 0; 2482 r.r_pad = 0; 2483 2483 buffer_mem (&sst_reloc, &r, sizeof (r)); 2484 2484 return ptr; … … 2522 2522 const char *p; 2523 2523 2524 if (s-> type != N_FUN)2524 if (s->n_type != N_FUN) 2525 2525 return FALSE; 2526 p = strchr (str_ptr + s-> string, ':');2526 p = strchr (str_ptr + s->n_un.n_strx, ':'); 2527 2527 if (p == NULL) 2528 2528 return FALSE; … … 2567 2567 if (is_fun (&sym_ptr[i])) 2568 2568 { 2569 addr = sym_ptr[i]. value;2569 addr = sym_ptr[i].n_value; 2570 2570 break; 2571 2571 } … … 2597 2597 --block_grow.count; 2598 2598 hll_end (block_stack[block_grow.count].patch_ptr, 0, 2599 sym_ptr[i]. value - block_stack[block_grow.count].addr);2599 sym_ptr[i].n_value - block_stack[block_grow.count].addr); 2600 2600 if (block_grow.count == 0 && proc_patch_base != 0) 2601 2601 fun_end (i); … … 2613 2613 { 2614 2614 struct type t, *t1, *t2; 2615 struct reloc r;2615 struct relocation_info r; 2616 2616 const char *str, *p; 2617 2617 char *name; 2618 2618 int n, ti; 2619 2619 2620 str = str_ptr + symbol-> string;2620 str = str_ptr + symbol->n_un.n_strx; 2621 2621 p = strchr (str, ':'); 2622 2622 if (p == NULL) … … 2627 2627 name[n] = 0; 2628 2628 2629 proc_start_addr = symbol-> value;2629 proc_start_addr = symbol->n_value; 2630 2630 2631 2631 if (args_grow.count == 0) … … 2646 2646 make_type (t2, &ti); 2647 2647 sst_start (cplusplus_flag ? SST_CPPproc : SST_proc); 2648 r. address = sst.size;2649 buffer_dword (&sst, symbol-> value); /* Segment offset */2648 r.r_address = sst.size; 2649 buffer_dword (&sst, symbol->n_value); /* Segment offset */ 2650 2650 buffer_word (&sst, ti); /* Type index */ 2651 2651 proc_patch_base = sst.size; … … 2660 2660 buffer_nstr (&sst, name); /* Proc name */ 2661 2661 sst_end (); 2662 r. ext= 0;2663 r. length = 2;2664 r. symbolnum = N_TEXT;2665 r. pcrel = 0;2666 r. unused = 0;2662 r.r_extern = 0; 2663 r.r_length = 2; 2664 r.r_symbolnum = N_TEXT; 2665 r.r_pcrel = 0; 2666 r.r_pad = 0; 2667 2667 buffer_mem (&sst_reloc, &r, sizeof (r)); 2668 2668 } … … 2677 2677 lbrac_index = -1; 2678 2678 for (; i < sym_count; ++i) 2679 if (sym_ptr[i]. type == N_RBRAC || is_fun (&sym_ptr[i]))2679 if (sym_ptr[i].n_type == N_RBRAC || is_fun (&sym_ptr[i])) 2680 2680 return; 2681 else if (sym_ptr[i]. type == N_LBRAC)2681 else if (sym_ptr[i].n_type == N_LBRAC) 2682 2682 { 2683 2683 lbrac_index = i; 2684 block_begin (sym_ptr[i]. value);2684 block_begin (sym_ptr[i].n_value); 2685 2685 return; 2686 2686 } … … 2715 2715 memcpy (name, str, n); 2716 2716 name[n] = 0; 2717 #if defined ( DEBUG)2717 #if defined (HLL_DEBUG) 2718 2718 printf ("%s %s\n", msg, str); 2719 2719 #endif … … 2727 2727 ++parse_ptr; 2728 2728 ti = hll_type (); 2729 #if defined ( DEBUG)2729 #if defined (HLL_DEBUG) 2730 2730 printf (" type=%#x\n", ti); 2731 2731 #endif … … 2736 2736 return; 2737 2737 } 2738 if (sym2-> type == N_EXT)2738 if (sym2->n_type == N_EXT) 2739 2739 sst_static (name, 0, ti, sym2 - sym_ptr, 1); 2740 2740 else 2741 sst_static (name, sym2-> value, ti, sym2->type, 0);2741 sst_static (name, sym2->n_value, ti, sym2->n_type, 0); 2742 2742 break; 2743 2743 … … 2755 2755 ++parse_ptr; 2756 2756 ti = hll_type (); 2757 #if defined ( DEBUG)2757 #if defined (HLL_DEBUG) 2758 2758 printf (" type=%#x\n", ti); 2759 2759 #endif 2760 sst_static (name, symbol-> value, ti, where, 0);2760 sst_static (name, symbol->n_value, ti, where, 0); 2761 2761 break; 2762 2762 … … 2774 2774 { 2775 2775 ti = hll_type (); 2776 #if defined ( DEBUG)2776 #if defined (HLL_DEBUG) 2777 2777 printf (" type=%#x\n", ti); 2778 2778 #endif 2779 2779 sst_start (SST_auto); 2780 buffer_dword (&sst, symbol-> value);/* Offset into stk frame */2780 buffer_dword (&sst, symbol->n_value);/* Offset into stk frame */ 2781 2781 buffer_word (&sst, ti); /* Type index */ 2782 2782 buffer_nstr (&sst, name); /* Symbol name */ … … 2802 2802 ++parse_ptr; 2803 2803 ti = hll_type (); 2804 switch (symbol-> value)2804 switch (symbol->n_value) 2805 2805 { 2806 2806 case 0: /* EAX */ … … 2853 2853 break; 2854 2854 default: 2855 warning ("unknown register %lu", symbol-> value);2855 warning ("unknown register %lu", symbol->n_value); 2856 2856 return; 2857 2857 } … … 2874 2874 } 2875 2875 ti = hll_type (); 2876 #if defined ( DEBUG)2876 #if defined (HLL_DEBUG) 2877 2877 printf (" type=%#x\n", ti); 2878 2878 #endif 2879 2879 sst_start (SST_auto); 2880 buffer_dword (&sst, symbol-> value);/* Offset into stk frame */2880 buffer_dword (&sst, symbol->n_value); /* Offset into stk frame */ 2881 2881 buffer_word (&sst, ti); /* Type index */ 2882 2882 buffer_nstr (&sst, name); /* Symbol name */ … … 2906 2906 last_fun_valid = TRUE; 2907 2907 args_grow.count = 0; 2908 last_fun_addr = symbol-> value;2908 last_fun_addr = symbol->n_value; 2909 2909 prologue_length = -1; 2910 2910 2911 for (i = *index + 1; i < sym_count && sym_ptr[i]. type == N_PSYM; ++i)2911 for (i = *index + 1; i < sym_count && sym_ptr[i].n_type == N_PSYM; ++i) 2912 2912 parse_symbol (&i, -1, "PSYM", FALSE); 2913 2913 … … 2920 2920 { 2921 2921 if (prologue_length == -1) 2922 prologue_length = sym_ptr[lbrac_index]. value - last_fun_addr;2922 prologue_length = sym_ptr[lbrac_index].n_value - last_fun_addr; 2923 2923 } 2924 2924 2925 2925 /* Parameters */ 2926 2926 2927 while (*index + 1 < sym_count && sym_ptr[*index+1]. type == N_PSYM)2927 while (*index + 1 < sym_count && sym_ptr[*index+1].n_type == N_PSYM) 2928 2928 { 2929 2929 ++(*index); … … 2999 2999 static void write_changseg (void) 3000 3000 { 3001 struct reloc r;3001 struct relocation_info r; 3002 3002 3003 3003 sst_start (SST_changseg); 3004 r. address = sst.size;3004 r.r_address = sst.size; 3005 3005 buffer_word (&sst, 0); /* Segment number */ 3006 3006 buffer_word (&sst, 0); /* Reserved */ 3007 3007 sst_end (); 3008 r. ext= 0;3009 r. length = 1;3010 r. symbolnum = N_TEXT;3011 r. pcrel = 0;3012 r. unused = 0;3008 r.r_extern = 0; 3009 r.r_length = 1; 3010 r.r_symbolnum = N_TEXT; 3011 r.r_pcrel = 0; 3012 r.r_pad = 0; 3013 3013 buffer_mem (&sst_reloc, &r, sizeof (r)); 3014 3014 } … … 3039 3039 3040 3040 for (i = 0; i < sym_count; ++i) 3041 switch (sym_ptr[i]. type)3041 switch (sym_ptr[i].n_type) 3042 3042 { 3043 3043 case N_LSYM: … … 3064 3064 lbrac_index = -1; block_grow.count = 0; proc_patch_base = 0; 3065 3065 for (i = 0; i < sym_count; ++i) 3066 switch (sym_ptr[i]. type)3066 switch (sym_ptr[i].n_type) 3067 3067 { 3068 3068 case N_LSYM: … … 3088 3088 case N_LBRAC: 3089 3089 if (lbrac_index == -1) /* N_LBRAC without local symbols */ 3090 block_begin (sym_ptr[i]. value);3090 block_begin (sym_ptr[i].n_value); 3091 3091 else if (i != lbrac_index) 3092 3092 warning ("Invalid N_LBRAC"); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxstack/emxstack.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 28 28 #include "defs.h" 29 29 30 #define VERSION "0.9d"31 #include "../../../../include/innotekversion.h"32 33 30 /* How to open a file. This type is used for my_open(). */ 34 31 … … 222 219 static void usage (void) 223 220 { 224 fputs ("emxstack " VERSION INNOTEK_VERSION" -- "221 fputs ("emxstack " VERSION " -- " 225 222 "Copyright (c) 1994-1995 by Eberhard Mattes\n\n", stderr); 226 223 fputs ("Usage: emxstack <command> [<options>] <file>...\n", stderr); … … 553 550 new_stack_size = ROUND_PAGE (n * 1024); 554 551 } 555 552 556 553 557 554 /* The main function of emxstack. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxstack/emxstack.smak
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 6 6 .TKIND := $(TOOLFMT) 7 7 .TSRC := $(wildcard src/emxstack/*.c) 8 .TCF := $(CFLAGS.DEF.VERSION) 8 9 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxtsf/emxtsf.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 26 26 #include <sys/moddef.h> 27 27 28 /* The version number of this program. This is printed with the usage29 message. */30 31 #define VERSION "0.9d"32 #include "../../../../include/innotekversion.h"33 34 28 35 29 struct sym … … 62 56 static void usage (void) 63 57 { 64 fputs ("emxtsf " VERSION INNOTEK_VERSION" -- Copyright (c) 1996 by Eberhard Mattes\n\n"58 fputs ("emxtsf " VERSION " -- Copyright (c) 1996 by Eberhard Mattes\n\n" 65 59 "Usage: emxtsf [-d <dll_name>] [-w <level>] <tss_file> <map_file> <def_file>\n", 66 60 stderr); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/emxtsf/emxtsf.smak
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 7 7 .TKIND := $(TOOLFMT) 8 8 .TSRC := $(wildcard src/emxtsf/*.c) 9 .TCF := $(CFLAGS.DEF.VERSION) 9 10 .TLDF := -lmoddef 10 11 include mkexe.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/include/defs.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 35 35 #define DATASEG_MAGIC 0xba0bab 36 36 37 38 /* Stabs constants. */39 40 #define N_EXT 0x01 /* Symbol is external */41 #define N_ABS 0x02 /* Absolute address */42 #define N_TEXT 0x04 /* In .text segment */43 #define N_DATA 0x06 /* In .data segment */44 #define N_BSS 0x08 /* In .bss segment */45 46 #define N_INDR 0x0a47 48 /* Copied from aout64.h of BFD */49 #define N_WEAKU 0x0d /* Weak undefined symbol. */50 #define N_WEAKA 0x0e /* Weak absolute symbol. */51 #define N_WEAKT 0x0f /* Weak text symbol. */52 #define N_WEAKD 0x10 /* Weak data symbol. */53 #define N_WEAKB 0x11 /* Weak bss symbol. */54 55 #define N_SETA 0x1456 #define N_SETT 0x1657 #define N_SETD 0x1858 59 #define N_GSYM 0x2060 #define N_FUN 0x2461 #define N_STSYM 0x2662 #define N_LCSYM 0x2863 #define N_RSYM 0x4064 #define N_SLINE 0x4465 #define N_SO 0x6466 #define N_LSYM 0x8067 #define N_SOL 0x8468 #define N_PSYM 0xa069 #define N_LBRAC 0xc070 #define N_RBRAC 0xe071 72 #define N_IMP1 0x68 /* Import reference (emx specific) */73 #define N_IMP2 0x6a /* Import definition (emx specific) */74 75 37 /* The maximum OMF record size supported by OMF linkers. This value 76 38 includes the record type, length and checksum fields. */ 77 78 39 #define MAX_REC_SIZE 1024 79 40 80 /* OMF record types. To get the 32-bit variant of a record type, add 81 REC32. */ 82 83 #define THEADR 0x80 /* Translator module header record */ 84 #define COMENT 0x88 /* Comment record */ 85 #define MODEND 0x8a /* Module end record */ 86 #define EXTDEF 0x8c /* External names definition record */ 87 #define TYPDEF 0x8e /* Type definition record */ 88 #define PUBDEF 0x90 /* Public names definition record */ 89 #define LINNUM 0x94 /* Line numbers record */ 90 #define LNAMES 0x96 /* List of names record */ 91 #define SEGDEF 0x98 /* Segment definition record */ 92 #define GRPDEF 0x9a /* Group definition record */ 93 #define FIXUPP 0x9c /* Fixup record */ 94 #define LEDATA 0xa0 /* Logical enumerated data record */ 95 #define LIDATA 0xa2 /* Logical iterated data record */ 96 #define COMDEF 0xb0 /* Communal names definition record */ 97 #define COMDAT 0xc2 /* Common block */ 98 #define ALIAS 0xc6 /* Alias definition record */ 99 #define LIBHDR 0xf0 /* Library header */ 100 #define LIBEND 0xf1 /* Library end */ 101 102 /* Add this constant (using the | operator) to get the 32-bit variant 103 of a record type. Some fields will contain 32-bit values instead 104 of 16-bit values. */ 105 106 #define REC32 0x01 107 108 /* BIND_OFFSET is the offset from the beginning of the emxbind patch 109 area to the data fields of that area. The first BIND_OFFSET bytes 110 of the emxbind patch area are used for storing the emx version 111 number. */ 112 113 #define BIND_OFFSET 16 114 115 41 #ifndef _BYTE_WORD_DWORD 42 #define _BYTE_WORD_DWORD 116 43 typedef unsigned char byte; 117 44 typedef unsigned short word; 118 45 typedef unsigned long dword; 119 120 /* The header of an a.out file. */ 121 122 struct a_out_header 123 { 124 word magic; /* Magic word, must be 0407 */ 125 byte machtype; /* Machine type */ 126 byte flags; /* Flags */ 127 long text_size; /* Length of text, in bytes */ 128 long data_size; /* Length of initialized data, in bytes */ 129 long bss_size; /* Length of uninitialized data, in bytes */ 130 long sym_size; /* Length of symbol table, in bytes */ 131 long entry; /* Start address (entry point) */ 132 long trsize; /* Length of relocation info for text, bytes */ 133 long drsize; /* Length of relocation info for data, bytes */ 134 }; 135 136 /* This is the layout of a relocation table entry. */ 137 138 struct reloc 139 { 140 dword address; /* Fixup location */ 141 dword symbolnum:24; /* Symbol number or segment */ 142 dword pcrel:1; /* Self-relative fixup if non-zero */ 143 dword length:2; /* Fixup size (0: 1 byte, 1: 2, 2: 4 bytes) */ 144 dword ext:1; /* Reference to symbol or segment */ 145 dword unused:4; /* Not used */ 146 }; 147 148 /* This is the layout of a symbol table entry. */ 149 150 struct nlist 151 { 152 dword string; /* Offset in string table */ 153 byte type; /* Type of the symbol */ 154 byte other; /* Other information */ 155 word desc; /* More information */ 156 dword value; /* Value (address) */ 157 }; 46 #endif /* _BYTE_WORD_DWORD */ 158 47 159 48 /* This is the header of a DOS executable file. */ 160 161 49 struct exe1_header 162 50 { … … 177 65 /* This is an additional header of a DOS executable file. It contains 178 66 a pointer to the new EXE header. */ 179 180 67 struct exe2_header 181 68 { … … 186 73 187 74 /* This is the layout of the OS/2 LX header. */ 188 189 75 struct os2_header 190 76 { … … 240 126 241 127 /* This is the layout of an object table entry. */ 242 243 128 struct object 244 129 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/include/libc-alias.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 19 19 the function is declared (not used) which will mark the function as 20 20 'aliased'. 21 */22 21 23 #define CONCAT(x,y) x ## y24 25 /*26 22 The following macro means exactly the following: 27 23 The function is a standard (POSIX) function that should … … 30 26 In fact, such functions can be referenced by three different names: 31 27 say, if you use _STD(xxx) you can reference later std_xxx, xxx 32 or _xxx - all names will have one value. 28 or _xxx - all names will point to the same function (of course, 29 if you don't have a function with one of those three names). 33 30 */ 34 #define _STD(x) CONCAT(_std_,x) 31 #define _STD(x) _std_ ## x 32 33 /* The libc-std.h file is auto-generated from all libc .c files 34 and contains lines like ``#define malloc _STD(malloc)'' */ 35 #include "libc-std.h" 35 36 36 37 #endif /* __LIBC_ALIAS_H__ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/ld/ld.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r235 r236 24 24 #include <ar.h> 25 25 #include <stdio.h> 26 #ifdef __EMX__27 26 #include <stdlib.h> 28 27 #include <io.h> 29 #include <process.h> /* for running emxbind */28 #include <process.h> 30 29 #include <errno.h> 31 30 #include <utime.h> 32 #endif /* __EMX__ */33 31 #include <ctype.h> 34 32 #include <sys/types.h> … … 39 37 #include <sys/resource.h> 40 38 #endif 41 #ifndef sony_news 42 #include <fcntl.h> 43 #endif 44 45 #if !defined(A_OUT) && !defined(MACH_O) 39 40 #if !defined(A_OUT) 46 41 #define A_OUT 47 42 #endif 48 43 49 44 #ifdef A_OUT 50 #ifdef COFF_ENCAPSULATE51 #include "a.out.encap.h"52 #else53 #ifdef __EMX__54 45 #include <a_out.h> 55 #else /* !__EMX__ */56 #include <a.out.h>57 #endif /* !__EMX__ */58 46 #endif 59 #endif 60 61 #ifdef MACH_O 62 #ifndef A_OUT 63 #include <nlist.h> 64 #include <reloc.h> 65 #endif 66 #ifndef N_TEXT 67 #define N_TEXT 0x04 68 #define N_DATA 0x06 69 #define N_BSS 0x08 70 #endif 71 #include <sys/loader.h> 72 #endif 73 74 #ifdef EMX /* fix bugs */ 75 76 /* Fix two bugs in processing of set vectors: 77 78 o The size of the set vector section is not correctly computed 79 80 o References to set vectors can be wrong by up to sizeof (double) - 1 81 bytes because padding occurs at the wrong place */ 82 83 #define FIXSETBUG 84 /* gcc will warn on __attribute__((system)) but still will compile */ 47 48 /* old gcc will warn on __attribute__((system)) but still will compile */ 85 49 extern int __attribute__((system)) DosCopy (char *, char *, int); 86 #endif /* EMX */87 50 88 51 /* We need .data of every module aligned to at least 16 bound … … 91 54 #define SECTION_ALIGN_MASK (SECTION_ALIGN-1) 92 55 93 #ifndef N_SET_MAGIC94 #define N_SET_MAGIC(exec, val) ((exec).a_magic = val)95 #endif96 97 56 /* If compiled with GNU C, use the built-in alloca */ 98 57 #ifdef __GNUC__ 99 58 # define alloca __builtin_alloca 100 59 #else 101 # if defined(sun) && defined(sparc) 102 # include "alloca.h" 103 # else 104 char *alloca (); 105 # endif 60 # include "alloca.h" 106 61 #endif 107 62 … … 114 69 #include "symseg.h" 115 70 116 #ifdef USG117 #include <string.h>118 #else119 71 #include <strings.h> 120 #endif121 72 122 73 /* Determine whether we should attempt to handle (minimally) … … 149 100 whose native format is different. */ 150 101 /* #define NON_NATIVE */ 151 152 /* Define this to specify the default executable format. */153 154 #ifdef hpux155 #define DEFAULT_OUTPUT_STYLE OUTPUT_READONLY_TEXT156 #endif157 158 /* Ordinary 4.3bsd lacks these macros in a.out.h. */159 160 #ifndef N_TXTADDR161 #if defined(vax) || defined(sony_news) || defined(hp300) || defined(pyr)162 #define N_TXTADDR(X) 0163 #endif164 #ifdef is68k165 #define N_TXTADDR(x) (sizeof (struct exec))166 #endif167 #ifdef sequent168 #define N_TXTADDR(x) (N_ADDRADJ(x))169 #endif170 #ifdef NeXT171 #define N_TXTADDR(X) ((X).a_magic == ZMAGIC ? page_size : 0)172 #endif173 #endif174 175 #ifndef N_DATADDR176 #if defined(vax) || defined(sony_news) || defined(hp300) || defined(pyr)177 #define N_DATADDR(x) \178 (((x).a_magic==OMAGIC)? (N_TXTADDR(x)+(x).a_text) \179 : (page_size+((N_TXTADDR(x)+(x).a_text-1) & ~(page_size-1))))180 #endif181 #ifdef is68k182 #define SEGMENT_SIZE 0x20000183 #define N_DATADDR(x) \184 (((x).a_magic==Omagic)? (N_TXTADDR(x)+(x).a_text) \185 : (SEGMENT_SIZE + ((N_TXTADDR(x)+(x).a_text-1) & ~(SEGMENT_SIZE-1))))186 #endif187 #ifdef sequent188 #define N_DATADDR(x) \189 (((x).a_magic==OMAGIC)? (N_TXTADDR(x)+(x).a_text) \190 : (page_size+(((x).a_text-1) & ~(page_size-1))))191 #endif192 #ifdef NeXT193 #define N_DATADDR(X) \194 (((X).a_magic==ZMAGIC)?(N_TXTADDR(X)+(X).a_text+0xFFFF)&~0xFFFF \195 :N_TXTADDR(X)+(X).a_text)196 #endif197 #endif198 102 199 103 /* The "address" of the data segment in a relocatable file. … … 203 107 N_TXTADDR from N_DATADDR to get the "address" for the input file. */ 204 108 #define DATA_ADDR_DOT_O(hdr) (N_DATADDR(hdr) - N_TXTADDR(hdr)) 205 206 /* Define how to initialize system-dependent header fields. */207 #ifdef sun208 #ifdef sparc209 #define INITIALIZE_HEADER \210 {outheader.a_machtype = M_SPARC; outheader.a_toolversion = 1;}211 #endif /* sparc. */212 #if defined(mc68000)213 /* Set the machine type according to the machine type of the .o files.214 If they are all sun2 (68010), then the type of the executable is sun2.215 If any is sun3 (68020), then the type of the executable is sun3.216 This is consistent with the Sun loader and more useful than having217 it depend on which machine you are on when you run ld. */218 static int sun_machtype = M_68010;219 #define INITIALIZE_HEADER outheader.a_machtype = sun_machtype220 #define READ_HEADER_HOOK(machtype) \221 if (machtype == M_68020) \222 { \223 sun_machtype = M_68020; \224 }225 #endif /* mc68000. */226 #endif /* Sun. */227 228 #ifdef ALTOS229 #define INITIALIZE_HEADER N_SET_MACHTYPE (outheader, M_68020)230 #endif231 #ifdef is68k232 #ifdef M_68020233 /* ISI rel 4.0D doesn't use it, and rel 3.05 doesn't have an234 a_machtype field and so won't recognize the magic number. To keep235 binary compatibility for now, just ignore it */236 #define INITIALIZE_HEADER outheader.a_machtype = 0;237 #endif238 #endif239 #ifdef hpux240 #define INITIALIZE_HEADER N_SET_MACHTYPE (outheader, HP9000S200_ID)241 #endif242 #if defined(i386) && !defined(sequent)243 #define INITIALIZE_HEADER N_SET_MACHTYPE (outheader, M_386)244 #endif /* Sequent symmetry. */245 #if defined(hp300)246 #define INITIALIZE_HEADER outheader.a_mid = MID_HP300247 #endif /* hp300. */248 #ifdef pyr249 #define INITIALIZE_HEADER outheader.a_machid = PYR90X250 #endif /* Pyramid. */251 252 #ifdef is68k253 /* This enables code to take care of an ugly hack in the ISI OS.254 If a symbol beings with _$, then the object file is included only255 if the rest of the symbol name has been referenced. */256 #define DOLLAR_KLUDGE257 #endif258 109 259 110 /* Values for 3rd argument to lseek(). */ … … 344 195 */ 345 196 346 #if defined(sun) && defined(sparc)347 /* Sparc (Sun 4) macros */348 #undef relocation_info349 #define relocation_info reloc_info_sparc350 #define RELOC_ADDRESS(r) ((r)->r_address)351 #define RELOC_EXTERN_P(r) ((r)->r_extern)352 #define RELOC_TYPE(r) ((r)->r_index)353 #define RELOC_SYMBOL(r) ((r)->r_index)354 #define RELOC_MEMORY_SUB_P(r) 0355 #define RELOC_MEMORY_ADD_P(r) 0356 #define RELOC_ADD_EXTRA(r) ((r)->r_addend)357 #define RELOC_PCREL_P(r) \358 ((r)->r_type >= RELOC_DISP8 && (r)->r_type <= RELOC_WDISP22)359 #define RELOC_VALUE_RIGHTSHIFT(r) (reloc_target_rightshift[(r)->r_type])360 #define RELOC_TARGET_SIZE(r) (reloc_target_size[(r)->r_type])361 #define RELOC_TARGET_BITPOS(r) 0362 #define RELOC_TARGET_BITSIZE(r) (reloc_target_bitsize[(r)->r_type])363 364 /* Note that these are very dependent on the order of the enums in365 enum reloc_type (in a.out.h); if they change the following must be366 changed */367 /* Also note that the last few may be incorrect; I have no information */368 static int reloc_target_rightshift[] = {369 0, 0, 0, 0, 0, 0, 2, 2, 10, 0, 0, 0, 0, 0, 0,370 };371 static int reloc_target_size[] = {372 0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,373 };374 static int reloc_target_bitsize[] = {375 8, 16, 32, 8, 16, 32, 30, 22, 22, 22, 13, 10, 32, 32, 16,376 };377 378 #define MAX_ALIGNMENT (sizeof (double))379 #endif380 381 #ifdef sequent382 #define RELOC_ADDRESS(r) ((r)->r_address)383 #define RELOC_EXTERN_P(r) ((r)->r_extern)384 #define RELOC_TYPE(r) ((r)->r_symbolnum)385 #define RELOC_SYMBOL(r) ((r)->r_symbolnum)386 #define RELOC_MEMORY_SUB_P(r) ((r)->r_bsr)387 #define RELOC_MEMORY_ADD_P(r) 1388 #undef RELOC_ADD_EXTRA389 #define RELOC_PCREL_P(r) ((r)->r_pcrel || (r)->r_bsr)390 #define RELOC_VALUE_RIGHTSHIFT(r) 0391 #define RELOC_TARGET_SIZE(r) ((r)->r_length)392 #define RELOC_TARGET_BITPOS(r) 0393 #define RELOC_TARGET_BITSIZE(r) 32394 #endif395 396 197 /* Default macros */ 397 198 #ifndef RELOC_ADDRESS … … 623 424 /* Nonzero means print a message at all refs or defs of this symbol */ 624 425 char trace; 625 #ifdef EMX /* WEAKU */626 426 /* One of N_WEAKX values */ 627 427 char weak; 628 #endif /* EMX */629 428 } 630 429 symbol; … … 632 431 /* Demangler for C++. */ 633 432 extern char *cplus_demangle (); 634 #ifdef EMX /* demangling */635 433 #include "demangle.h" 636 434 static char *my_cplus_demangle (); 637 435 int demangle_options; 638 #endif /* EMX */639 436 640 437 /* Demangler function to use. We unconditionally enable the C++ demangler … … 642 439 by the C++ compiler. Enabling it only if -lg++ was specified seems too 643 440 much of a kludge. */ 644 #ifdef EMX /* demangling */645 441 char *(*demangler)() = my_cplus_demangle; 646 #else /* !EMX */647 char *(*demangler)() = cplus_demangle;648 #endif /* !EMX */649 442 650 443 /* Number of buckets in symbol hash table */ … … 801 594 unsigned long int symseg_size; 802 595 long int symseg_offset; 803 804 #ifdef MACH_O805 /* Section ordinals from the Mach-O load commands. These806 are compared with the n_sect fields of symbols. */807 int text_ordinal;808 int data_ordinal;809 int bss_ordinal;810 #endif811 596 812 597 /* Describe data from the file loaded into core */ … … 891 676 892 677 char *output_filename; 893 #ifdef EMX /* emxbind, relocatable */894 678 char *exe_filename; 895 679 char *def_filename = NULL; … … 907 691 EMX_DEFAULT, RSXNT_WIN32, RSXNT_RSX, RSXNT_EMX 908 692 } rsxnt_linked = EMX_DEFAULT; 909 #endif /* EMX */910 693 911 694 /* What kind of output file to write. */ … … 914 697 915 698 #ifndef DEFAULT_OUTPUT_FILE_TYPE 916 #ifdef MACH_O917 #define DEFAULT_OUTPUT_FILE_TYPE IS_MACH_O918 #else919 699 #define DEFAULT_OUTPUT_FILE_TYPE IS_A_OUT 920 #endif921 700 #endif 922 701 … … 983 762 unsigned long *set_vectors; 984 763 985 #ifdef EMX /* relocatable */986 764 int *set_reloc; 987 #endif /* EMX */988 765 989 766 /* Amount of cleared space to leave at the end of the text segment. */ … … 991 768 int text_pad; 992 769 993 #ifdef FIXSETBUG994 770 /* Amount of padding between data segment and set vectors. */ 995 771 int set_sect_pad; 996 #endif /* FIXSETBUG */997 772 998 773 /* Amount of padding at end of data segment. This has two parts: … … 1055 830 1056 831 /* Standard directories to search for files specified by -l. */ 1057 char *standard_search_dirs[] = 1058 #ifdef STANDARD_SEARCH_DIRS 1059 {STANDARD_SEARCH_DIRS}; 1060 #else 1061 #ifdef NON_NATIVE 1062 {"/usr/local/lib/gnu"}; 1063 #else 1064 #ifdef __EMX__ 1065 {"/emx/lib"}; 1066 #else /* !__EMX__ */ 1067 {"/lib", "/usr/lib", "/usr/local/lib"}; 1068 #endif /* !__EMX__ */ 1069 #endif 1070 #endif 832 char *standard_search_dirs[] = { "/usr/lib" }; 1071 833 1072 834 /* If set STANDARD_SEARCH_DIRS is not searched. */ … … 1093 855 struct glosym **cmdline_references; 1094 856 int cl_refs_allocated; 1095 1096 #ifndef bcopy1097 void bcopy (), bzero ();1098 #endif1099 #ifndef __EMX__1100 char *malloc (), *realloc ();1101 void free ();1102 #endif /* !__EMX__ */1103 857 1104 858 char *xmalloc (); … … 1135 889 symbol *getsym (), *getsym_soft (); 1136 890 void do_warnings (); 1137 #ifdef EMX /* emxbind */1138 891 void check_exe (void); 1139 #endif /* EMX */1140 892 1141 893 … … 1145 897 int argc; 1146 898 { 1147 #ifdef __EMX__1148 899 _response (&argc, &argv); 1149 900 _wildcard (&argc, &argv); 1150 #endif /* __EMX__ */1151 901 page_size = getpagesize (); 1152 902 progname = argv[0]; … … 1171 921 data_reloc_size = 0; 1172 922 1173 #ifdef FIXSETBUG1174 923 set_sect_pad = 0; 1175 #endif /* FIXSETBUG */1176 924 data_pad = 0; 1177 925 text_pad = 0; … … 1217 965 decode_command (argc, argv); 1218 966 1219 #ifdef EMX /* emxbind */1220 967 check_exe (); 1221 #endif /* EMX */1222 968 1223 969 /* Load symbols of all input files. … … 1278 1024 {"M", 0, 0, 'M'}, 1279 1025 {"N", 0, 0, 'N'}, 1280 #ifdef EMX /* emxbind, relocatable, demangling */1281 1026 {"R", 0, 0, 'R'}, /* Create relocatable executable */ 1282 1027 {"Zexe", 0, 0, 135}, /* Create .exe file, touch `output file' */ … … 1288 1033 {"Zrsx32", 0, 0, 141}, /* Create Win32/DOS win32 base */ 1289 1034 {"Zemx32", 0, 0, 142}, /* Create Win32/DOS emx base */ 1290 #endif /* EMX */1291 1035 {"S", 0, 0, 'S'}, 1292 1036 {"T", 1, 0, 'T'}, … … 1448 1192 break; 1449 1193 1450 #ifdef EMX /* emxbind, relocatable, demangling */1451 1194 case 135: /* -Zexe */ 1452 1195 exe_flag = 1; … … 1485 1228 reloc_flag = 1; 1486 1229 break; 1487 #endif /* EMX */1488 1230 1489 1231 case 'S': … … 1540 1282 case 1: 1541 1283 /* Non-option argument. */ 1542 #ifdef EMX /* emxbind */1543 1284 { 1544 1285 char *ext = _getext (optarg); … … 1558 1299 } 1559 1300 } 1560 #endif /* EMX */1561 1301 p->filename = optarg; 1562 1302 p->local_sym_name = optarg; … … 1574 1314 1575 1315 case 'l': 1576 #ifdef __EMX__1577 1316 p->filename = concat ("", optarg, ".a"); 1578 #else /* !__EMX__ */1579 p->filename = concat ("lib", optarg, ".a");1580 #endif /* !__EMX__ */1581 1317 p->local_sym_name = concat ("-l", optarg, ""); 1582 1318 p->search_dirs_flag = 1; … … 1785 1521 register char *string 1786 1522 = concat (search_dirs[i], "/", entry->filename); 1787 #ifdef EMX /* host */1788 1523 desc = open (string, O_RDONLY|O_BINARY, 0); 1789 1524 1790 1525 if (desc < 0) 1791 1526 { 1792 char *tmp = _getext (entry->filename);1793 if (tmp && (tolower(tmp[1]) == 'a') && (tmp[2] == 0))1794 {1795 /* Try libxxx */1796 free (string);1797 string = concat (search_dirs[i], "/lib", entry->filename);1798 desc = open (string, O_RDONLY|O_BINARY, 0);1799 }1527 char *tmp = _getext (entry->filename); 1528 if (tmp && (tolower(tmp[1]) == 'a') && (tmp[2] == 0)) 1529 { 1530 /* Try libxxx */ 1531 free (string); 1532 string = concat (search_dirs[i], "/lib", entry->filename); 1533 desc = open (string, O_RDONLY|O_BINARY, 0); 1534 } 1800 1535 } 1801 #else /* !EMX */1802 desc = open (string, O_RDONLY, 0);1803 #endif /* !EMX */1804 1536 if (desc > 0) 1805 1537 { … … 1812 1544 } 1813 1545 else 1814 #ifdef __EMX__1815 1546 desc = open (entry->filename, O_RDONLY|O_BINARY, 0); 1816 #else /* !__EMX__ */1817 desc = open (entry->filename, O_RDONLY, 0);1818 #endif /* !__EMX__ */1819 1547 1820 1548 if (desc > 0) … … 1911 1639 1912 1640 lseek (desc, entry->starting_offset, 0); 1913 #ifdef COFF_ENCAPSULATE1914 if (entry->just_syms_flag)1915 /* Since a file given with -A will have a coff header, unlike normal1916 input files, we need to skip over it. */1917 lseek (desc, sizeof (coffheader), SEEK_CUR);1918 #endif1919 1641 len = read (desc, (char *) &hdr, sizeof (struct exec)); 1920 1642 if (len == sizeof (struct exec) && !N_BADMAG (hdr)) … … 1926 1648 #endif 1927 1649 1928 #ifdef MACH_O1929 {1930 struct mach_header hdr;1931 1932 lseek (desc, entry->starting_offset, 0);1933 len = read (desc, (char *) &hdr, sizeof (struct mach_header));1934 if (len == sizeof (struct mach_header) && hdr.magic == MH_MAGIC)1935 {1936 entry->file_type = IS_MACH_O;1937 return;1938 }1939 }1940 #endif1941 1942 1650 fatal_with_file ("malformed input file (not rel or archive) ", entry); 1943 1651 } … … 1956 1664 1957 1665 lseek (desc, entry->starting_offset, 0); 1958 1959 #ifdef COFF_ENCAPSULATE1960 if (entry->just_syms_flag)1961 /* Since a file given with -A will have a coff header, unlike normal1962 input files, we need to skip over it. */1963 lseek (desc, sizeof (coffheader), SEEK_CUR);1964 #endif1965 1966 1666 read (desc, (char *) &hdr, sizeof (struct exec)); 1967 1667 … … 2041 1741 #endif 2042 1742 2043 #ifdef MACH_O2044 /* Read a Mach-O file's header. DESC is the descriptor on which the2045 file is open, and ENTRY is the file's entry. */2046 void2047 read_mach_o_header (desc, entry)2048 int desc;2049 struct file_entry *entry;2050 {2051 struct mach_header mach_header;2052 char *hdrbuf;2053 struct load_command *load_command;2054 struct segment_command *segment_command;2055 struct section *section;2056 struct symtab_command *symtab_command;2057 #ifdef LC_SYMSEG2058 struct symseg_command *symseg_command;2059 #endif2060 int ordinal;2061 int symtab_seen, symseg_seen;2062 int len, cmd, seg;2063 2064 entry->text_ordinal = entry->data_ordinal = entry->bss_ordinal = 0;2065 symtab_seen = symseg_seen = 0;2066 ordinal = 1;2067 2068 lseek (desc, entry->starting_offset, 0);2069 len = read (desc, (char *) &mach_header, sizeof (struct mach_header));2070 if (len != sizeof (struct mach_header))2071 fatal_with_file ("failure reading Mach-O header of ", entry);2072 if (mach_header.filetype != MH_OBJECT && mach_header.filetype != MH_EXECUTE)2073 fatal_with_file ("unsupported Mach-O file type (not MH_OBJECT or MH_EXECUTE) in ", entry);2074 hdrbuf = xmalloc (mach_header.sizeofcmds);2075 len = read (desc, hdrbuf, mach_header.sizeofcmds);2076 if (len != mach_header.sizeofcmds)2077 fatal_with_file ("failure reading Mach-O load commands of ", entry);2078 load_command = (struct load_command *) hdrbuf;2079 for (cmd = 0; cmd < mach_header.ncmds; ++cmd)2080 {2081 switch (load_command->cmd)2082 {2083 case LC_SEGMENT:2084 segment_command = (struct segment_command *) load_command;2085 section = (struct section *) ((char *) (segment_command + 1));2086 for (seg = 0; seg < segment_command->nsects; ++seg, ++section, ++ordinal)2087 {2088 if (!strncmp(SECT_TEXT, section->sectname, sizeof section->sectname))2089 if (entry->text_ordinal)2090 fatal_with_file ("more than one __text section in ", entry);2091 else2092 {2093 entry->text_ordinal = ordinal;2094 entry->orig_text_address = section->addr;2095 entry->text_size = section->size;2096 entry->text_offset = section->offset;2097 entry->text_reloc_size = section->nreloc * sizeof (struct relocation_info);2098 entry->text_reloc_offset = section->reloff;2099 }2100 else if (!strncmp(SECT_DATA, section->sectname, sizeof section->sectname))2101 if (entry->data_ordinal)2102 fatal_with_file ("more than one __data section in ", entry);2103 else2104 {2105 entry->data_ordinal = ordinal;2106 entry->orig_data_address = section->addr;2107 entry->data_size = section->size;2108 entry->data_offset = section->offset;2109 entry->data_reloc_size = section->nreloc * sizeof (struct relocation_info);2110 entry->data_reloc_offset = section->reloff;2111 }2112 else if (!strncmp(SECT_BSS, section->sectname, sizeof section->sectname))2113 if (entry->bss_ordinal)2114 fatal_with_file ("more than one __bss section in ", entry);2115 else2116 {2117 entry->bss_ordinal = ordinal;2118 entry->orig_bss_address = section->addr;2119 entry->bss_size = section->size;2120 }2121 else2122 if (section->size != 0)2123 fprintf (stderr, "%s: warning: unknown section `%.*s' in %s\n",2124 progname, sizeof section->sectname, section->sectname,2125 entry->filename);2126 }2127 break;2128 case LC_SYMTAB:2129 if (symtab_seen)2130 fatal_with_file ("more than one LC_SYMTAB in ", entry);2131 else2132 {2133 symtab_seen = 1;2134 symtab_command = (struct symtab_command *) load_command;2135 entry->syms_size = symtab_command->nsyms * sizeof (struct nlist);2136 entry->syms_offset = symtab_command->symoff;2137 entry->strs_size = symtab_command->strsize;2138 entry->strs_offset = symtab_command->stroff;2139 }2140 break;2141 #ifdef LC_SYMSEG2142 case LC_SYMSEG:2143 if (symseg_seen)2144 fatal_with_file ("more than one LC_SYMSEG in ", entry);2145 else2146 {2147 symseg_seen = 1;2148 symseg_command = (struct symseg_command *) load_command;2149 entry->symseg_size = symseg_command->size;2150 entry->symseg_offset = symseg_command->offset;2151 }2152 break;2153 #endif2154 }2155 load_command = (struct load_command *)2156 ((char *) load_command + load_command->cmdsize);2157 }2158 2159 free (hdrbuf);2160 2161 if (!symtab_seen)2162 fprintf (stderr, "%s: no symbol table in %s\n", progname, entry->filename);2163 }2164 #endif2165 2166 1743 /* Read a file's header info into the proper place in the file_entry. 2167 1744 DESC is the descriptor on which the file is open. … … 2190 1767 break; 2191 1768 #endif 2192 2193 #ifdef MACH_O2194 case IS_MACH_O:2195 read_mach_o_header (desc, entry);2196 break;2197 #endif2198 1769 } 2199 1770 2200 1771 entry->header_read_flag = 1; 2201 1772 } 2202 2203 #ifdef MACH_O2204 void translate_mach_o_symbols ();2205 #endif2206 1773 2207 1774 /* Read the symbols of file ENTRY into core. … … 2221 1788 if (entry->syms_size != read (desc, entry->symbols, entry->syms_size)) 2222 1789 fatal_with_file ("premature end of file in symbols of ", entry); 2223 2224 #ifdef MACH_O2225 if (entry->file_type == IS_MACH_O)2226 translate_mach_o_symbols (entry);2227 #endif2228 1790 } 2229 1791 … … 2314 1876 { 2315 1877 if (p->n_type == (N_SETV | N_EXT)) continue; 2316 #ifdef EMX /* import, relocatable */2317 1878 if (p->n_type == (N_IMP1 | N_EXT)) 2318 1879 reloc_flag = 1; 2319 #endif /* EMX */2320 1880 if (set_element_prefixes 2321 1881 && set_element_prefixed_p (p->n_un.n_strx + entry->strings)) … … 2353 1913 } 2354 1914 } 2355 #ifdef __EMX__2356 1915 else if (WEAK_SYMBOL (p->n_type)) 2357 1916 { … … 2362 1921 enter_global_ref (p, p->n_un.n_strx + entry->strings, entry); 2363 1922 } 2364 #endif2365 1923 else if (p->n_type & N_EXT) 2366 1924 enter_global_ref (p, p->n_un.n_strx + entry->strings, entry); … … 2409 1967 sp->referenced = 1; 2410 1968 2411 #ifdef EMX /* WEAK symbol support */2412 1969 if (WEAK_SYMBOL (type)) 2413 1970 { … … 2421 1978 /*(type == N_WEAKB)*/ N_BSS | N_EXT; 2422 1979 } 2423 #endif /* EMX */2424 1980 2425 1981 if (type != (N_UNDF | N_EXT) || nlist_p->n_value) … … 2467 2023 a symbol being equivalenced to. */ 2468 2024 nlist_p->n_value 2469 #ifndef NeXT2470 2025 = (unsigned int) getsym ((nlist_p + 1)->n_un.n_strx 2471 2026 + entry->strings); 2472 #else2473 /* NeXT also has indirection but they do it weirdly. */2474 = (unsigned int) getsym (nlist_p->n_value + entry->strings);2475 #endif2476 2027 if ((symbol *) nlist_p->n_value == sp) 2477 2028 { … … 2492 2043 else 2493 2044 if (!oldref) 2494 #ifndef DOLLAR_KLUDGE2495 2045 undefined_global_sym_count++; 2496 #else2497 {2498 if (entry->superfile && type == (N_UNDF | N_EXT) && name[1] == '$')2499 {2500 /* This is an (ISI?) $-conditional; skip it */2501 sp->referenced = 0;2502 if (sp->trace)2503 {2504 fprintf (stderr, "symbol %s is a $-conditional ignored in ", sp->name);2505 print_file_name (entry, stderr);2506 fprintf (stderr, "\n");2507 }2508 return;2509 }2510 else2511 undefined_global_sym_count++;2512 }2513 #endif2514 2046 2515 2047 if (sp == end_symbol && entry->just_syms_flag && !T_flag_specified) … … 2569 2101 break; 2570 2102 2571 #ifdef sequent2572 case N_SHUNDF:2573 reftype = "shared undf";2574 break;2575 2576 /* These conflict with cases above.2577 case N_SHDATA:2578 reftype = "shared data";2579 break;2580 2581 case N_SHBSS:2582 reftype = "shared BSS";2583 break;2584 */2585 #endif2586 2587 #ifdef EMX /* import & WEAK */2588 2103 case N_IMP1: 2589 2104 reftype = "imported"; 2590 2105 break; 2106 2591 2107 case N_WEAKU & ~N_EXT: 2592 2108 reftype = "weak"; 2593 2109 break; 2110 2594 2111 case N_WEAKT & ~N_EXT: 2595 2112 reftype = "weak text"; 2596 2113 break; 2114 2597 2115 case N_WEAKD & ~N_EXT: 2598 2116 reftype = "weak data"; 2599 2117 break; 2600 #endif /* EMX */2601 2118 2602 2119 default: … … 2949 2466 register struct nlist *end 2950 2467 = entry->symbols + entry->syms_size / sizeof (struct nlist); 2951 #ifdef DOLLAR_KLUDGE2952 register int dollar_cond = 0;2953 #endif2954 2468 2955 2469 for (p = entry->symbols; p < end; p++) … … 2960 2474 /* If the symbol has an interesting definition, we could 2961 2475 potentially want it. */ 2962 if (((type & N_EXT) 2963 #ifdef __EMX__ 2964 || WEAK_SYMBOL (type) 2965 #endif 2966 ) 2967 && (type != (N_UNDF | N_EXT) || p->n_value 2968 #ifdef DOLLAR_KLUDGE 2969 || name[1] == '$' 2970 #endif 2971 ) 2476 if (((type & N_EXT) || WEAK_SYMBOL (type)) 2477 && (type != (N_UNDF | N_EXT) || p->n_value) 2972 2478 && !SET_ELEMENT_P (type) 2973 2479 && !set_element_prefixed_p (name)) … … 2975 2481 register symbol *sp = getsym_soft (name); 2976 2482 2977 #ifdef DOLLAR_KLUDGE2978 if (name[1] == '$')2979 {2980 sp = getsym_soft (&name[2]);2981 dollar_cond = 1;2982 if (!sp) continue;2983 if (sp->referenced)2984 {2985 if (write_map)2986 {2987 print_file_name (entry, stdout);2988 fprintf (stdout, " needed due to $-conditional %s\n", name);2989 }2990 return 1;2991 }2992 continue;2993 }2994 #endif2995 2996 2483 /* If this symbol has not been hashed, we can't be looking for it. */ 2997 2484 … … 3002 2489 pipe() from the library. But the bug fix kingdon made was wrong. */ 3003 2490 || (sp->defined && sp->max_common_size 3004 #ifdef EMX 3005 && type != (N_INDR | N_EXT) 3006 #endif /* EMX */ 3007 )) 2491 && type != (N_INDR | N_EXT))) 3008 2492 { 3009 2493 /* This is a symbol we are looking for. It is either 3010 2494 not yet defined or defined as a common. */ 3011 #ifdef DOLLAR_KLUDGE3012 if (dollar_cond) continue;3013 #endif3014 2495 if (type == (N_UNDF | N_EXT)) 3015 2496 { … … 3086 2567 initialize_data_start (); 3087 2568 3088 #ifdef FIXSETBUG3089 2569 /* Make sure the set vectors are aligned properly. */ 3090 2570 { … … 3095 2575 data_size = new_data_size; 3096 2576 } 3097 #else /* !FIXSETBUG */3098 /* Make sure bss starts out aligned as much as anyone can want. */3099 {3100 int new_data_size = (data_size + SECTION_ALIGN_MASK) & ~SECTION_ALIGN_MASK;3101 3102 data_pad += new_data_size - data_size;3103 data_size = new_data_size;3104 }3105 #endif /* !FIXSETBUG */3106 2577 3107 2578 /* Set up the set element vector */ … … 3113 2584 vector, plus a word for each symbol for a zero at the end of 3114 2585 the vector (for incremental linking). */ 3115 #ifdef FIXSETBUG3116 2586 set_sect_size 3117 2587 = (set_symbol_count + 2 * set_vector_count) * sizeof (unsigned long); 3118 #else /* !FIXSETBUG */3119 set_sect_size3120 = (2 * set_symbol_count + set_vector_count) * sizeof (unsigned long);3121 #endif /* !FIXSETBUG */3122 2588 set_sect_start = data_start + data_size; 3123 2589 data_size += set_sect_size; 3124 2590 set_vectors = (unsigned long *) xmalloc (set_sect_size); 3125 #ifdef EMX /* relocatable */3126 2591 set_reloc = (int *) xmalloc (set_sect_size / sizeof (unsigned long) 3127 2592 * sizeof (int)); 3128 #endif /* EMX */3129 2593 setv_fill_count = 0; 3130 2594 } 3131 2595 3132 #ifdef FIXSETBUG3133 2596 /* Make sure bss starts out aligned as much as anyone can want. */ 3134 2597 { … … 3138 2601 data_size = new_data_size; 3139 2602 } 3140 #endif /* FIXSETBUG */3141 2603 3142 2604 /* Compute start addresses of each file's sections and symbols. */ … … 3184 2646 multiple_def_count++; 3185 2647 } 3186 #ifdef EMX /* relocatable */3187 2648 set_reloc[setv_fill_count] = TYPE_OF_SET_ELEMENT (type); 3188 2649 if ((type & ~N_EXT) != N_SETA) 3189 2650 data_reloc_size += sizeof (struct relocation_info); 3190 #endif /* EMX */3191 2651 set_vectors[setv_fill_count++] = p->n_value; 3192 2652 } 3193 #ifdef EMX /* import */3194 2653 else if ((type & N_EXT) && type != (N_UNDF | N_EXT) 3195 2654 && type != (N_IMP1 | N_EXT)) 3196 #else /* !EMX */3197 else if ((type & N_EXT) && type != (N_UNDF | N_EXT))3198 #endif /* !EMX */3199 2655 { 3200 2656 /* non-common definition */ … … 3258 2714 unsigned long i, tmp; 3259 2715 3260 #ifdef EMX /* relocatable */3261 2716 set_reloc[length_word_index] = N_ABS; 3262 #endif /* EMX */3263 2717 set_vectors[length_word_index] 3264 2718 = setv_fill_count - 1 - length_word_index; … … 3269 2723 i++) 3270 2724 { 3271 #ifdef EMX /* relocatable */3272 2725 tmp = set_reloc[length_word_index + i]; 3273 2726 set_reloc[length_word_index + i] 3274 2727 = set_reloc[setv_fill_count - i]; 3275 2728 set_reloc[setv_fill_count - i] = (int)tmp; 3276 #endif /* EMX */ 2729 3277 2730 tmp = set_vectors[length_word_index + i]; 3278 2731 set_vectors[length_word_index + i] … … 3281 2734 } 3282 2735 3283 #ifdef EMX /* relocatable */3284 2736 set_reloc[setv_fill_count] = N_ABS; 3285 #endif /* EMX */3286 2737 set_vectors[setv_fill_count++] = 0; 3287 2738 } 3288 #ifdef EMX /* Unresolved weak symbols should be zero */3289 2739 if (!sp->defined && WEAK_SYMBOL (sp->weak)) 3290 2740 { … … 3293 2743 undefined_global_sym_count--; 3294 2744 } 3295 #endif /* EMX */3296 2745 if (sp->defined) 3297 2746 defined_global_sym_count++; … … 3495 2944 /* If this is a definition, 3496 2945 update it if necessary by this file's start address. */ 3497 if ( !(p->n_type & (N_STAB | N_EXT)) &&3498 !SET_ELEMENT_P (p->n_type))2946 if (((output_style == OUTPUT_RELOCATABLE) && SET_ELEMENT_P (p->n_type)) 2947 || (!(p->n_type & (N_STAB | N_EXT)) && !SET_ELEMENT_P (p->n_type))) 3499 2948 fprintf (outfile, " %s: 0x%lx\n", 3500 2949 entry->strings + p->n_un.n_strx, p->n_value); … … 4038 3487 struct exec outheader; 4039 3488 4040 #ifdef COFF_ENCAPSULATE4041 int need_coff_header;4042 struct coffheader coffheader;4043 #endif4044 4045 3489 /* Compute text_start and text_header_size for an a.out file. */ 4046 3490 … … 4073 3517 This depends on the kind of system and on the output format selected. */ 4074 3518 N_SET_MAGIC (outheader, magic); 3519 N_SET_MACHTYPE (outheader, M_386); 4075 3520 #ifdef INITIALIZE_HEADER 4076 3521 INITIALIZE_HEADER; … … 4078 3523 4079 3524 text_header_size = sizeof (struct exec); 4080 #ifdef COFF_ENCAPSULATE4081 /* Don't write the coff header for the output of ld -A (since4082 it is not executable by the kernel anyway). */4083 if (output_style != OUTPUT_RELOCATABLE && !file_table[0].just_syms_flag)4084 {4085 need_coff_header = 1;4086 /* set this flag now, since it will change the values of N_TXTOFF, etc */4087 N_SET_FLAGS (outheader, N_FLAGS_COFF_ENCAPSULATE);4088 text_header_size += sizeof (struct coffheader);4089 }4090 #endif4091 3525 if (text_header_size <= N_TXTOFF (outheader)) 4092 3526 text_header_size = 0; … … 4109 3543 { 4110 3544 outheader.a_text = text_size; 4111 #ifdef sequent4112 outheader.a_text += N_ADDRADJ (outheader);4113 if (entry_symbol == 0)4114 entry_symbol = getsym ("start");4115 #endif4116 3545 if (! Tdata_flag_specified) 4117 3546 data_start = N_DATADDR (outheader) + text_start - N_TXTADDR (outheader); … … 4127 3556 outheader.a_entry = (entry_symbol ? entry_symbol->value 4128 3557 : text_start + text_header_size); 4129 4130 #ifdef COFF_ENCAPSULATE4131 if (need_coff_header)4132 {4133 /* We are encapsulating BSD format within COFF format. */4134 struct coffscn *tp, *dp, *bp;4135 4136 tp = &coffheader.scns[0];4137 dp = &coffheader.scns[1];4138 bp = &coffheader.scns[2];4139 4140 strcpy (tp->s_name, ".text");4141 tp->s_paddr = text_start;4142 tp->s_vaddr = text_start;4143 tp->s_size = text_size;4144 tp->s_scnptr = sizeof (struct coffheader) + sizeof (struct exec);4145 tp->s_relptr = 0;4146 tp->s_lnnoptr = 0;4147 tp->s_nreloc = 0;4148 tp->s_nlnno = 0;4149 tp->s_flags = 0x20;4150 strcpy (dp->s_name, ".data");4151 dp->s_paddr = data_start;4152 dp->s_vaddr = data_start;4153 dp->s_size = data_size;4154 dp->s_scnptr = tp->s_scnptr + tp->s_size;4155 dp->s_relptr = 0;4156 dp->s_lnnoptr = 0;4157 dp->s_nreloc = 0;4158 dp->s_nlnno = 0;4159 dp->s_flags = 0x40;4160 strcpy (bp->s_name, ".bss");4161 bp->s_paddr = dp->s_vaddr + dp->s_size;4162 bp->s_vaddr = bp->s_paddr;4163 bp->s_size = bss_size;4164 bp->s_scnptr = 0;4165 bp->s_relptr = 0;4166 bp->s_lnnoptr = 0;4167 bp->s_nreloc = 0;4168 bp->s_nlnno = 0;4169 bp->s_flags = 0x80;4170 4171 coffheader.f_magic = COFF_MAGIC;4172 coffheader.f_nscns = 3;4173 /* store an unlikely time so programs can4174 * tell that there is a bsd header4175 */4176 coffheader.f_timdat = 1;4177 coffheader.f_symptr = 0;4178 coffheader.f_nsyms = 0;4179 coffheader.f_opthdr = 28;4180 coffheader.f_flags = 0x103;4181 /* aouthdr */4182 coffheader.magic = ZMAGIC;4183 coffheader.vstamp = 0;4184 coffheader.tsize = tp->s_size;4185 coffheader.dsize = dp->s_size;4186 coffheader.bsize = bp->s_size;4187 coffheader.entry = outheader.a_entry;4188 coffheader.text_start = tp->s_vaddr;4189 coffheader.data_start = dp->s_vaddr;4190 }4191 #endif4192 3558 4193 3559 if (strip_symbols == STRIP_ALL) … … 4203 3569 /* One extra for following reference on indirects */ 4204 3570 if (output_style == OUTPUT_RELOCATABLE) 4205 #ifndef NeXT4206 3571 nsyms += set_symbol_count + global_indirect_count; 4207 #else4208 nsyms += set_symbol_count;4209 #endif4210 3572 } 4211 3573 … … 4215 3577 outheader.a_syms = nsyms * sizeof (struct nlist); 4216 3578 4217 #ifdef EMX /* relocatable */4218 3579 if (output_style == OUTPUT_RELOCATABLE || reloc_flag) 4219 #else /* !EMX */4220 if (output_style == OUTPUT_RELOCATABLE)4221 #endif /* !EMX */4222 3580 { 4223 3581 outheader.a_trsize = text_reloc_size; … … 4266 3624 { 4267 3625 lseek (outdesc, 0L, 0); 4268 4269 #ifdef COFF_ENCAPSULATE4270 if (need_coff_header)4271 mywrite (&coffheader, sizeof coffheader, 1, outdesc);4272 #endif4273 4274 3626 mywrite (&outheader, sizeof (struct exec), 1, outdesc); 4275 4276 /* Output whatever padding is required in the executable file4277 between the header and the start of the text. */4278 4279 #ifndef COFF_ENCAPSULATE4280 padfile (N_TXTOFF (outheader) - sizeof outheader, outdesc);4281 #endif4282 }4283 4284 #endif4285 4286 4287 #ifdef MACH_O4288 4289 /* Stuff pertaining to creating Mach-O files. */4290 4291 /* Convert the Mach-O style n_sect references into something the rest4292 of the loader can understand. */4293 4294 void4295 translate_mach_o_symbols (entry)4296 struct file_entry *entry;4297 {4298 int i, n, g;4299 struct nlist *sym;4300 4301 n = entry->syms_size / sizeof (struct nlist);4302 for (i = 0; i < n; ++i)4303 if (((sym = &entry->symbols[i])->n_type & ~N_EXT) == N_SECT)4304 {4305 if (sym->n_sect == entry->text_ordinal)4306 sym->n_type = (sym->n_type & N_EXT) | N_TEXT;4307 else if (sym->n_sect == entry->data_ordinal)4308 sym->n_type = (sym->n_type & N_EXT) | N_DATA;4309 else if (sym->n_sect == entry->bss_ordinal)4310 sym->n_type = (sym->n_type & N_EXT) | N_BSS;4311 else4312 fatal_with_file ("unknown section referenced in symbols of ", entry);4313 sym->n_sect = 0;4314 }4315 else if ((sym = &entry->symbols[i])->n_type == N_SLINE)4316 {4317 if (sym->n_sect == entry->text_ordinal)4318 sym->n_type = N_SLINE;4319 else if (sym->n_sect == entry->data_ordinal)4320 sym->n_type = N_DSLINE;4321 else if (sym->n_sect == entry->bss_ordinal)4322 sym->n_type = N_BSLINE;4323 else4324 fatal_with_file ("unknown section referenced in debugging symbols of ", entry);4325 }4326 }4327 4328 /* Convert Mach-O style relocation info into a.out style relocation4329 info internally. */4330 void4331 translate_mach_o_relocation (entry, reloc, count)4332 struct file_entry *entry;4333 struct relocation_info *reloc;4334 int count;4335 {4336 int i;4337 4338 for (i = 0; i < count; ++i)4339 if (!RELOC_EXTERN_P(&reloc[i]))4340 if (RELOC_TYPE(&reloc[i]) == R_ABS)4341 RELOC_TYPE(&reloc[i]) = N_ABS;4342 else if (RELOC_TYPE(&reloc[i]) == entry->text_ordinal)4343 RELOC_TYPE(&reloc[i]) = N_TEXT;4344 else if (RELOC_TYPE(&reloc[i]) == entry->data_ordinal)4345 RELOC_TYPE(&reloc[i]) = N_DATA;4346 else if (RELOC_TYPE(&reloc[i]) == entry->bss_ordinal)4347 RELOC_TYPE(&reloc[i]) = N_BSS;4348 else4349 fatal_with_file ("unknown section ordinal in relocation info of ", entry);4350 }4351 4352 /* Header structure for OUTPUT_RELOCATABLE. */4353 4354 struct4355 {4356 struct mach_header header;4357 struct segment_command segment;4358 struct section text;4359 struct section data;4360 struct section bss;4361 struct symtab_command symtab;4362 #ifdef LC_SYMSEG4363 struct symseg_command symseg;4364 #endif4365 } m_object;4366 4367 #ifdef NeXT4368 #define CPU_TYPE CPU_TYPE_MC680304369 #define CPU_SUBTYPE CPU_SUBTYPE_NeXT4370 #define THREAD_FLAVOR NeXT_THREAD_STATE_REGS4371 #define THREAD_COUNT NeXT_THREAD_STATE_REGS_COUNT4372 typedef struct NeXT_thread_state_regs thread_state;4373 #define thread_state_entry_field pc4374 #endif4375 4376 /* Header structure for all executable output forms. */4377 4378 struct4379 {4380 struct mach_header header;4381 struct segment_command pagezero;4382 struct segment_command text_segment;4383 struct section text;4384 struct segment_command data_segment;4385 struct section data;4386 struct section bss;4387 struct thread_command unixthread;4388 unsigned long int flavor;4389 unsigned long int count;4390 thread_state state;4391 struct symtab_command symtab;4392 #ifdef LC_SYMSEG4393 struct symseg_command symseg;4394 #endif4395 } m_exec;4396 4397 /* Compute text_start and text_header_size for an a.out file. */4398 4399 void4400 initialize_mach_o_text_start ()4401 {4402 if (output_style != OUTPUT_RELOCATABLE)4403 {4404 text_header_size = sizeof m_exec;4405 if (!T_flag_specified && output_style != OUTPUT_RELOCATABLE)4406 /* We reserve the first page of an executable to trap NULL dereferences. */4407 text_start = page_size;4408 }4409 }4410 4411 /* Compute data_start once text_size is known. */4412 4413 void4414 initialize_mach_o_data_start ()4415 {4416 if (! Tdata_flag_specified)4417 data_start = text_start + text_size;4418 }4419 4420 /* Compute offsets of various pieces of the Mach-O output file. */4421 void4422 compute_mach_o_section_offsets ()4423 {4424 int header_size, trsize, drsize;4425 4426 switch (output_style)4427 {4428 case OUTPUT_RELOCATABLE:4429 header_size = sizeof m_object;4430 break;4431 default:4432 header_size = sizeof m_exec;4433 break;4434 }4435 4436 if (strip_symbols == STRIP_ALL)4437 nsyms = 0;4438 else4439 {4440 nsyms = (defined_global_sym_count4441 + undefined_global_sym_count);4442 if (discard_locals == DISCARD_L)4443 nsyms += non_L_local_sym_count;4444 else if (discard_locals == DISCARD_NONE)4445 nsyms += local_sym_count;4446 /* One extra for following reference on indirects */4447 if (output_style == OUTPUT_RELOCATABLE)4448 #ifndef NeXT4449 nsyms += set_symbol_count + global_indirect_count;4450 #else4451 nsyms += set_symbol_count;4452 #endif4453 }4454 4455 if (strip_symbols == STRIP_NONE)4456 nsyms += debugger_sym_count;4457 4458 output_text_offset = header_size;4459 output_data_offset = output_text_offset + text_size;4460 output_trel_offset = output_data_offset + data_size;4461 if (output_style == OUTPUT_RELOCATABLE)4462 trsize = text_reloc_size, drsize = data_reloc_size;4463 else4464 trsize = drsize = 0;4465 output_drel_offset = output_trel_offset + trsize;4466 output_syms_offset = output_drel_offset + drsize;4467 output_strs_offset = output_syms_offset + nsyms * sizeof (struct nlist);4468 }4469 4470 /* Compute more section offsets once the size of the string table is known. */4471 void4472 compute_more_mach_o_section_offsets ()4473 {4474 output_symseg_offset = output_strs_offset + output_strs_size;4475 }4476 4477 /* Write the Mach-O header once everything else is known. */4478 4479 void4480 write_mach_o_header ()4481 {4482 struct mach_header header;4483 struct section text, data, bss;4484 struct symtab_command symtab;4485 #ifdef LC_SYMSEG4486 struct symseg_command symseg;4487 #endif4488 thread_state state;4489 4490 lseek (outdesc, 0L, 0);4491 4492 4493 header.magic = MH_MAGIC;4494 header.cputype = CPU_TYPE;4495 header.cpusubtype = CPU_SUBTYPE;4496 header.filetype = output_style == OUTPUT_RELOCATABLE ? MH_OBJECT : MH_EXECUTE;4497 #ifdef LC_SYMSEG4498 switch (output_style)4499 {4500 case OUTPUT_RELOCATABLE:4501 header.ncmds = 3;4502 header.sizeofcmds = sizeof m_object - sizeof header;4503 break;4504 default:4505 header.ncmds = 6;4506 header.sizeofcmds = sizeof m_exec - sizeof header;4507 break;4508 }4509 #else4510 switch (output_style)4511 {4512 case OUTPUT_RELOCATABLE:4513 header.ncmds = 2;4514 header.sizeofcmds = sizeof m_object - sizeof header;4515 break;4516 default:4517 header.ncmds = 5;4518 header.sizeofcmds = sizeof m_exec - sizeof header;4519 break;4520 }4521 #endif4522 header.flags = undefined_global_sym_count ? 0 : MH_NOUNDEFS;4523 4524 bzero((char *) &text, sizeof text);4525 strncpy(text.sectname, SECT_TEXT, sizeof text.sectname);4526 strncpy(text.segname, SEG_TEXT, sizeof text.segname);4527 text.addr = text_start;4528 text.size = text_size;4529 text.offset = output_text_offset;4530 text.align = text.addr % sizeof (double) ? sizeof (int) : sizeof (double);4531 text.reloff = output_trel_offset;4532 text.nreloc = output_style == OUTPUT_RELOCATABLE4533 ? text_reloc_size / sizeof (struct relocation_info) : 0;4534 text.flags = 0;4535 4536 bzero((char *) &data, sizeof data);4537 strncpy(data.sectname, SECT_DATA, sizeof data.sectname);4538 strncpy(data.segname, output_style == OUTPUT_WRITABLE_TEXT ? SEG_TEXT : SEG_DATA,4539 sizeof data.segname);4540 data.addr = data_start;4541 data.size = data_size;4542 data.offset = output_data_offset;4543 data.align = data.addr % sizeof (double) ? sizeof (int) : sizeof (double);4544 data.reloff = output_drel_offset;4545 data.nreloc = output_style == OUTPUT_RELOCATABLE4546 ? data_reloc_size / sizeof (struct relocation_info) : 0;4547 data.flags = 0;4548 4549 bzero((char *) &bss, sizeof bss);4550 strncpy(bss.sectname, SECT_BSS, sizeof data.sectname);4551 strncpy(bss.segname, output_style == OUTPUT_WRITABLE_TEXT ? SEG_TEXT : SEG_DATA,4552 sizeof bss.segname);4553 bss.addr = data_start + data_size;4554 bss.size = bss_size;4555 bss.align = bss.addr % sizeof (double) ? sizeof (int) : sizeof (double);4556 bss.reloff = 0;4557 bss.nreloc = 0;4558 bss.flags = S_ZEROFILL;4559 4560 symtab.cmd = LC_SYMTAB;4561 symtab.cmdsize = sizeof symtab;4562 symtab.symoff = output_syms_offset;4563 symtab.nsyms = output_syms_size / sizeof (struct nlist);4564 symtab.stroff = output_strs_offset;4565 symtab.strsize = output_strs_size;4566 4567 #ifdef LC_SYMSEG4568 symseg.cmd = LC_SYMSEG;4569 symseg.cmdsize = sizeof symseg;4570 symseg.offset = output_symseg_offset;4571 symseg.size = output_symseg_size;4572 #endif4573 4574 switch (output_style)4575 {4576 case OUTPUT_RELOCATABLE:4577 m_object.header = header;4578 m_object.segment.cmd = LC_SEGMENT;4579 m_object.segment.cmdsize = sizeof (struct segment_command) + 3 * sizeof (struct section);4580 strncpy(m_object.segment.segname, SEG_TEXT, sizeof m_object.segment.segname);4581 m_object.segment.vmaddr = 0;4582 m_object.segment.vmsize = text.size + data.size + bss.size;4583 m_object.segment.fileoff = text.offset;4584 m_object.segment.filesize = text.size + data.size;4585 m_object.segment.maxprot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;4586 m_object.segment.initprot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;4587 m_object.segment.nsects = 3;4588 m_object.segment.flags = 0;4589 m_object.text = text;4590 m_object.data = data;4591 m_object.bss = bss;4592 m_object.symtab = symtab;4593 #ifdef LC_SYMSEG4594 m_object.symseg = symseg;4595 #endif4596 mywrite((char *) &m_object, 1, sizeof m_object, outdesc);4597 break;4598 4599 default:4600 m_exec.header = header;4601 m_exec.pagezero.cmd = LC_SEGMENT;4602 m_exec.pagezero.cmdsize = sizeof (struct segment_command);4603 strncpy(m_exec.pagezero.segname, SEG_PAGEZERO, sizeof m_exec.pagezero.segname);4604 m_exec.pagezero.vmaddr = 0;4605 m_exec.pagezero.vmsize = page_size;4606 m_exec.pagezero.fileoff = 0;4607 m_exec.pagezero.filesize = 0;4608 m_exec.pagezero.maxprot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;4609 m_exec.pagezero.initprot = 0;4610 m_exec.pagezero.nsects = 0;4611 m_exec.pagezero.flags = 0;4612 m_exec.text_segment.cmd = LC_SEGMENT;4613 m_exec.text_segment.cmdsize = sizeof (struct segment_command) + sizeof (struct section);4614 strncpy(m_exec.text_segment.segname, SEG_TEXT, sizeof m_exec.text_segment.segname);4615 m_exec.text_segment.vmaddr = text_start;4616 m_exec.text_segment.vmsize = text_size;4617 m_exec.text_segment.fileoff = output_text_offset;4618 m_exec.text_segment.filesize = text_size;4619 m_exec.text_segment.maxprot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;4620 m_exec.text_segment.initprot = VM_PROT_READ | VM_PROT_EXECUTE;4621 if (output_style == OUTPUT_WRITABLE_TEXT)4622 m_exec.text_segment.initprot |= VM_PROT_WRITE;4623 m_exec.text_segment.nsects = 1;4624 m_exec.text_segment.flags = 0;4625 m_exec.text = text;4626 m_exec.data_segment.cmd = LC_SEGMENT;4627 m_exec.data_segment.cmdsize = sizeof (struct segment_command) + 2 * sizeof (struct section);4628 strncpy(m_exec.data_segment.segname, SEG_DATA, sizeof m_exec.data_segment.segname);4629 m_exec.data_segment.vmaddr = data_start;4630 m_exec.data_segment.vmsize = data_size + bss_size;4631 m_exec.data_segment.fileoff = output_data_offset;4632 m_exec.data_segment.filesize = data_size;4633 m_exec.data_segment.maxprot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;4634 m_exec.data_segment.initprot = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;4635 m_exec.data_segment.nsects = 2;4636 m_exec.data_segment.flags = 0;4637 m_exec.data = data;4638 m_exec.bss = bss;4639 m_exec.unixthread.cmd = LC_UNIXTHREAD;4640 m_exec.unixthread.cmdsize4641 = sizeof (struct thread_command) + 2 * sizeof (long int) + sizeof (thread_state);4642 m_exec.flavor = THREAD_FLAVOR;4643 m_exec.count = THREAD_COUNT;4644 m_exec.state.thread_state_entry_field = entry_symbol4645 ? entry_symbol->value : text_start + text_header_size;4646 m_exec.symtab = symtab;4647 #ifdef LC_SYMSEG4648 m_exec.symseg = symseg;4649 #endif4650 mywrite((char *) &m_exec, 1, sizeof m_exec, outdesc);4651 break;4652 }4653 }4654 4655 /* Translate a.out style symbols into Mach-O style symbols. */4656 4657 void4658 generate_mach_o_symbols (syms, nsyms)4659 struct nlist *syms;4660 int nsyms;4661 {4662 int i;4663 4664 for (i = 0; i < nsyms; ++i)4665 switch (syms[i].n_type)4666 {4667 case N_TEXT:4668 case N_TEXT | N_EXT:4669 syms[i].n_type = syms[i].n_type & N_EXT | N_SECT;4670 syms[i].n_sect = 1; /* text section ordinal */4671 break;4672 case N_DATA:4673 case N_DATA | N_EXT:4674 syms[i].n_type = syms[i].n_type & N_EXT | N_SECT;4675 syms[i].n_sect = 2; /* data section ordinal */4676 break;4677 case N_BSS:4678 case N_BSS | N_EXT:4679 syms[i].n_type = syms[i].n_type & N_EXT | N_BSS;4680 syms[i].n_sect = 3; /* bss section ordinal */4681 break;4682 case N_SLINE:4683 syms[i].n_type = N_SLINE;4684 syms[i].n_sect = 1; /* text section ordinal */4685 break;4686 case N_DSLINE:4687 syms[i].n_type = N_SLINE;4688 syms[i].n_sect = 2; /* data section ordinal */4689 break;4690 case N_BSLINE:4691 syms[i].n_type = N_SLINE;4692 syms[i].n_sect = 3; /* bss section ordinal */4693 break;4694 }4695 }4696 4697 /* Translate a.out style relocation info into Mach-O style relocation4698 info. */4699 4700 void4701 generate_mach_o_relocations (reloc, nreloc)4702 struct relocation_info *reloc;4703 int nreloc;4704 {4705 int i;4706 4707 for (i = 0; i < nreloc; ++i)4708 if (!RELOC_EXTERN_P (&reloc[i]))4709 switch (RELOC_TYPE (&reloc[i]))4710 {4711 case N_ABS:4712 case N_ABS | N_EXT:4713 RELOC_TYPE (&reloc[i]) = R_ABS;4714 break;4715 case N_TEXT:4716 case N_TEXT | N_EXT:4717 RELOC_TYPE (&reloc[i]) = 1; /* output text section ordinal */4718 break;4719 case N_DATA:4720 case N_DATA | N_EXT:4721 RELOC_TYPE (&reloc[i]) = 2; /* output data section ordinal */4722 break;4723 case N_BSS:4724 case N_BSS | N_EXT:4725 RELOC_TYPE (&reloc[i]) = 3; /* output bss section ordinal */4726 break;4727 }4728 3627 } 4729 3628 … … 4747 3646 } 4748 3647 #endif 4749 #ifdef MACH_O 4750 if (output_file_type == IS_MACH_O) 4751 { 4752 initialize_mach_o_text_start (); 3648 fatal ("unknown output file type (enum file_type)", (char *) 0); 3649 } 3650 3651 /* Initialize data_start as appropriate to the output format, once text_size 3652 is known. */ 3653 3654 void 3655 initialize_data_start () 3656 { 3657 #ifdef A_OUT 3658 if (output_file_type == IS_A_OUT) 3659 { 3660 initialize_a_out_data_start (); 4753 3661 return; 4754 3662 } … … 4757 3665 } 4758 3666 4759 /* Initialize data_start as appropriate to the output format, once text_size 4760 is known. */ 4761 4762 void 4763 initialize_data_start () 3667 /* Compute offsets of the various sections within the output file. */ 3668 3669 void 3670 compute_section_offsets () 4764 3671 { 4765 3672 #ifdef A_OUT 4766 3673 if (output_file_type == IS_A_OUT) 4767 3674 { 4768 initialize_a_out_data_start (); 4769 return; 4770 } 4771 #endif 4772 #ifdef MACH_O 4773 if (output_file_type == IS_MACH_O) 4774 { 4775 initialize_mach_o_data_start (); 3675 compute_a_out_section_offsets (); 4776 3676 return; 4777 3677 } … … 4780 3680 } 4781 3681 4782 /* Compute offsets of the various sections within the output file. */4783 4784 void 4785 compute_ section_offsets ()3682 /* Compute more section offsets, once the size of the string table 3683 is finalized. */ 3684 void 3685 compute_more_section_offsets () 4786 3686 { 4787 3687 #ifdef A_OUT 4788 3688 if (output_file_type == IS_A_OUT) 4789 3689 { 4790 compute_a_out_section_offsets (); 4791 return; 4792 } 4793 #endif 4794 #ifdef MACH_O 4795 if (output_file_type == IS_MACH_O) 4796 { 4797 compute_mach_o_section_offsets (); 3690 compute_more_a_out_section_offsets (); 4798 3691 return; 4799 3692 } … … 4802 3695 } 4803 3696 4804 /* Compute more section offsets, once the size of the string table 4805 is finalized. */ 4806 void 4807 compute_more_section_offsets () 3697 /* Write the output file header, once everything is known. */ 3698 void 3699 write_header () 4808 3700 { 4809 3701 #ifdef A_OUT 4810 3702 if (output_file_type == IS_A_OUT) 4811 3703 { 4812 compute_more_a_out_section_offsets (); 4813 return; 4814 } 4815 #endif 4816 #ifdef MACH_O 4817 if (output_file_type == IS_MACH_O) 4818 { 4819 compute_more_mach_o_section_offsets (); 3704 write_a_out_header (); 4820 3705 return; 4821 3706 } … … 4824 3709 } 4825 3710 4826 /* Write the output file header, once everything is known. */ 4827 void 4828 write_header () 4829 { 4830 #ifdef A_OUT 4831 if (output_file_type == IS_A_OUT) 4832 { 4833 write_a_out_header (); 4834 return; 4835 } 4836 #endif 4837 #ifdef MACH_O 4838 if (output_file_type == IS_MACH_O) 4839 { 4840 write_mach_o_header (); 4841 return; 4842 } 4843 #endif 4844 fatal ("unknown output file type (enum file_type)", (char *) 0); 4845 } 4846 4847 4848 #ifdef EMX /* emxbind */ 3711 4849 3712 /* Parse output_filename and decide whether to create an exe file or not */ 4850 3713 … … 4911 3774 unlink (touch_filename); 4912 3775 } 4913 #endif /* EMX */4914 3776 4915 3777 /* Write the output file */ … … 4931 3793 (void) unlink (output_filename); 4932 3794 4933 #ifdef __EMX__4934 3795 outdesc = open (output_filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666); 4935 #else /* !__EMX__ */4936 outdesc = open (output_filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);4937 #endif /* !__EMX__ */4938 3796 if (outdesc < 0) perror_name (output_filename); 4939 3797 … … 4943 3801 filemode = statbuf.st_mode; 4944 3802 4945 #ifndef __EMX__4946 3803 chmod (output_filename, filemode & ~0111); 4947 #endif /* !__EMX__ */ 4948 4949 #ifdef EMX /* relocatable */ 3804 4950 3805 if (reloc_flag) 4951 3806 global_indirect_count = 0; 4952 #endif /* EMX */4953 3807 4954 3808 /* Calculate the offsets of the various pieces of the output file. */ … … 4960 3814 4961 3815 /* Output the merged relocation info, if requested with `-r'. */ 4962 #ifdef EMX /* relocatable */4963 3816 if (output_style == OUTPUT_RELOCATABLE || reloc_flag) 4964 #else /* !EMX */4965 if (output_style == OUTPUT_RELOCATABLE)4966 #endif /* !EMX */4967 3817 write_rel (); 4968 3818 … … 4988 3838 perror_name (output_filename); 4989 3839 4990 #ifdef EMX /* emxbind */4991 3840 if (rsxnt_linked == EMX_DEFAULT && exe_filename != NULL) 4992 3841 { … … 5108 3957 } 5109 3958 } 5110 #endif /* EMX */5111 3959 } 5112 3960 … … 5175 4023 entry->datarel = reloc; 5176 4024 } 5177 5178 #ifdef MACH_O5179 if (entry->file_type == IS_MACH_O)5180 {5181 translate_mach_o_relocation (entry, entry->textrel,5182 entry->text_reloc_size / sizeof (struct relocation_info));5183 translate_mach_o_relocation (entry, entry->datarel,5184 entry->data_reloc_size / sizeof (struct relocation_info));5185 }5186 #endif5187 4025 } 5188 4026 … … 5211 4049 5212 4050 if (entry->textrel) reloc = entry->textrel; 5213 #ifdef EMX /* relocatable */5214 4051 else if (output_style == OUTPUT_RELOCATABLE || reloc_flag) 5215 #else /* !EMX */5216 else if (output_style == OUTPUT_RELOCATABLE)5217 #endif /* !EMX */5218 4052 { 5219 4053 read_file_relocation (entry); … … 5226 4060 if (entry->text_reloc_size != read (desc, reloc, entry->text_reloc_size)) 5227 4061 fatal_with_file ("premature eof in text relocation of ", entry); 5228 #ifdef MACH_O5229 if (entry->file_type == IS_MACH_O)5230 translate_mach_o_relocation (entry, reloc,5231 entry->text_reloc_size / sizeof (struct relocation_info));5232 #endif5233 4062 } 5234 4063 … … 5267 4096 description of length of the set vector section. */ 5268 4097 5269 #ifdef FIXSETBUG5270 4098 padfile (set_sect_pad, outdesc); 5271 #endif /* FIXSETBUG */5272 4099 5273 4100 if (set_vector_count) 5274 #ifdef FIXSETBUG5275 4101 mywrite (set_vectors, set_symbol_count + 2 * set_vector_count, 5276 4102 sizeof (unsigned long), outdesc); 5277 #else /* !FIXSETBUG */5278 mywrite (set_vectors, 2 * set_symbol_count + set_vector_count,5279 sizeof (unsigned long), outdesc);5280 #endif /* !FIXSETBUG */5281 4103 5282 4104 if (trace_files) … … 5307 4129 5308 4130 if (entry->datarel) reloc = entry->datarel; 5309 #ifdef EMX /* relocatable */5310 4131 else if (output_style == OUTPUT_RELOCATABLE || reloc_flag) /* Will need this again */ 5311 #else /* !EMX */5312 else if (output_style == OUTPUT_RELOCATABLE) /* Will need this again */5313 #endif /* !EMX */5314 4132 { 5315 4133 read_file_relocation (entry); … … 5322 4140 if (entry->data_reloc_size != read (desc, reloc, entry->data_reloc_size)) 5323 4141 fatal_with_file ("premature eof in data relocation of ", entry); 5324 #ifdef MACH_O5325 if (entry->file_type == IS_MACH_O)5326 translate_mach_o_relocation (entry, reloc,5327 entry->data_reloc_size / sizeof (struct relocation_info));5328 #endif5329 4142 } 5330 4143 … … 5459 4272 /* Unshifted mask for relocation */ 5460 4273 mask = (1 << RELOC_TARGET_BITSIZE(p)) - 1; 5461 mask |= mask - 1;5462 4274 relocation &= mask; 5463 4275 … … 5545 4357 { 5546 4358 sp->def_count = count++; 5547 #ifndef NeXT5548 4359 /* Leave room for the reference required by N_INDR, if 5549 4360 necessary. */ 5550 4361 if ((sp->defined & ~N_EXT) == N_INDR) 5551 #ifdef EMX /* relocatable */5552 4362 if (!reloc_flag) 5553 #endif /* EMX */ 5554 count++; 5555 #endif 4363 count++; 5556 4364 } 5557 4365 } 5558 4366 /* Correct, because if (OUTPUT_RELOCATABLE), we will also be writing 5559 4367 whatever indirect blocks we have. */ 5560 #ifndef NeXT5561 4368 if (count != defined_global_sym_count 5562 4369 + undefined_global_sym_count + global_indirect_count) 5563 #else5564 if (count != defined_global_sym_count5565 + undefined_global_sym_count)5566 #endif5567 4370 fatal ("internal error"); 5568 4371 … … 5577 4380 lseek (outdesc, output_drel_offset, 0); 5578 4381 each_full_file (copdatrel, 0); 5579 #ifdef EMX /* relocatable */5580 4382 if (reloc_flag) 5581 4383 { … … 5604 4406 } 5605 4407 } 5606 #endif /* EMX */5607 4408 5608 4409 if (trace_files) … … 5642 4443 to an internal one. */ 5643 4444 5644 #ifdef EMX /* import */5645 4445 if (symptr->defined && symptr->defined != (N_IMP1 | N_EXT)) 5646 #else /* !EMX */5647 if (symptr->defined)5648 #endif /* !EMX */5649 4446 { 5650 4447 RELOC_EXTERN_P(p) = 0; 5651 4448 RELOC_SYMBOL(p) = (symptr->defined & ~N_EXT); 5652 #ifdef EMX /* relocatable */5653 4449 if (RELOC_SYMBOL (p) == N_SETV) 5654 4450 RELOC_SYMBOL (p) = N_DATA; 5655 #endif /* EMX */5656 4451 #ifdef RELOC_ADD_EXTRA 5657 4452 /* If we aren't going to be adding in the value in … … 5666 4461 /* Debugger symbols come first, so have to start this 5667 4462 after them. */ 5668 #ifndef NeXT5669 4463 RELOC_SYMBOL(p) = (symptr->def_count + nsyms 5670 4464 - defined_global_sym_count 5671 4465 - undefined_global_sym_count 5672 4466 - global_indirect_count); 5673 #else5674 RELOC_SYMBOL(p) = (symptr->def_count + nsyms5675 - defined_global_sym_count5676 - undefined_global_sym_count);5677 #endif5678 4467 } 5679 4468 p++; 5680 4469 } 5681 5682 #ifdef MACH_O5683 if (output_file_type == IS_MACH_O)5684 generate_mach_o_relocations(entry->textrel,5685 entry->text_reloc_size / sizeof (struct relocation_info));5686 #endif5687 4470 5688 4471 mywrite (entry->textrel, 1, entry->text_reloc_size, outdesc); … … 5709 4492 if (RELOC_EXTERN_P(p)) 5710 4493 { 5711 register int symindex = RELOC_SYMBOL(p) * sizeof (struct nlist); 5712 symbol *symptr = ((symbol *) 5713 (((struct nlist *) 5714 (((char *)entry->symbols) + symindex)) 5715 ->n_un.n_name)); 4494 register int symindex = RELOC_SYMBOL(p); 4495 symbol *symptr = (symbol *)(entry->symbols [symindex].n_un.n_name); 5716 4496 int symtype; 5717 4497 5718 if (symindex >= entry->syms_size)4498 if (symindex >= (entry->syms_size / sizeof (struct nlist))) 5719 4499 fatal_with_file ("relocation symbolnum out of range in ", entry); 5720 4500 … … 5725 4505 #endif 5726 4506 5727 #ifdef EMX 5728 if ((symtype = symptr->defined) != (N_IMP1 | N_EXT)) 5729 #endif 5730 symtype = symptr->defined & ~N_EXT; 5731 5732 #ifdef EMX /* relocatable */ 5733 if ((force_common_definition || reloc_flag) 5734 && (symtype != (N_IMP1 | N_EXT))) 5735 #endif /* EMX */ 4507 symtype = symptr->defined & ~N_EXT; 4508 5736 4509 if (force_common_definition 5737 || symtype == N_DATA || symtype == N_TEXT || symtype == N_ABS) 4510 || (reloc_flag && symtype != N_IMP1) 4511 || symtype == N_DATA || symtype == N_TEXT 4512 || symtype == N_ABS || symtype == N_BSS) 5738 4513 { 5739 #ifdef EMX /* relocatable */5740 4514 if (symtype == N_SETV) 5741 4515 symtype = N_DATA; 5742 #endif /* EMX */5743 4516 RELOC_EXTERN_P(p) = 0; 5744 4517 RELOC_SYMBOL(p) = symtype; … … 5747 4520 /* Debugger symbols come first, so have to start this 5748 4521 after them. */ 5749 #ifndef NeXT 5750 RELOC_SYMBOL(p) 5751 #ifdef EMX 5752 = (symptr 5753 #else /* not EMX */ 5754 = (((symbol *) 5755 (((struct nlist *) 5756 (((char *)entry->symbols) + symindex)) 5757 ->n_un.n_name)) 5758 #endif /* not EMX */ 5759 ->def_count 4522 RELOC_SYMBOL(p) = (symptr->def_count 5760 4523 + nsyms - defined_global_sym_count 5761 4524 - undefined_global_sym_count 5762 4525 - global_indirect_count); 5763 #else 5764 RELOC_SYMBOL(p) 5765 = (((symbol *) 5766 (((struct nlist *) 5767 (((char *)entry->symbols) + symindex)) 5768 ->n_un.n_name)) 5769 ->def_count 5770 + nsyms - defined_global_sym_count 5771 - undefined_global_sym_count); 4526 4527 #if 0 4528 if ((symtype = symptr->defined) != (N_IMP1 | N_EXT)) 4529 symtype = symptr->defined & ~N_EXT; 4530 4531 if ((force_common_definition || reloc_flag) 4532 && (symtype != (N_IMP1 | N_EXT))) 4533 { 4534 if (force_common_definition 4535 || symtype == N_DATA || symtype == N_TEXT || symtype == N_ABS) 4536 { 4537 if (symtype == N_SETV) 4538 symtype = N_DATA; 4539 RELOC_EXTERN_P(p) = 0; 4540 RELOC_SYMBOL(p) = symtype; 4541 } 4542 else 4543 /* Debugger symbols come first, so have to start this 4544 after them. */ 4545 RELOC_SYMBOL(p) = (symptr->def_count 4546 + nsyms - defined_global_sym_count 4547 - undefined_global_sym_count 4548 - global_indirect_count); 4549 } 5772 4550 #endif 5773 4551 } 5774 4552 p++; 5775 4553 } 5776 #ifdef MACH_O5777 if (output_file_type == IS_MACH_O)5778 generate_mach_o_relocations(entry->datarel,5779 entry->data_reloc_size / sizeof (struct relocation_info));5780 #endif5781 4554 5782 4555 mywrite (entry->datarel, 1, entry->data_reloc_size, outdesc); … … 5832 4605 5833 4606 if (!outstream) 5834 #ifdef __EMX__5835 4607 outstream = fdopen (outdesc, "wb"); 5836 #else /* !__EMX__ */5837 outstream = fdopen (outdesc, "w");5838 #endif /* !__EMX__ */5839 4608 5840 4609 for (i = 0; i < strtab_index; i++) … … 5865 4634 extra struct for each indirect symbol to hold the extra reference 5866 4635 following. */ 5867 struct nlist *buf 5868 #ifndef NeXT 5869 = (struct nlist *) alloca ((defined_global_sym_count 4636 struct nlist *buf = (struct nlist *) alloca ((defined_global_sym_count 5870 4637 + undefined_global_sym_count 5871 4638 + global_indirect_count) 5872 * sizeof (struct nlist)); 5873 #else 5874 = (struct nlist *) alloca ((defined_global_sym_count 5875 + undefined_global_sym_count) 5876 * sizeof (struct nlist)); 5877 #endif 4639 * sizeof (struct nlist)); 5878 4640 /* Pointer for storing into BUF. */ 5879 4641 register struct nlist *bufp = buf; … … 5955 4717 nl.n_value = sp->max_common_size; 5956 4718 } 5957 #ifdef EMX /* WEAK */5958 4719 else if (!sp->defined && sp->weak) 5959 4720 { … … 5961 4722 nl.n_value = 0; 5962 4723 } 5963 #endif /* EMX */5964 4724 else if (!sp->defined) /* undefined -- legit only if -r */ 5965 4725 { … … 5979 4739 syms_written++; 5980 4740 if (nl.n_type == (N_INDR | N_EXT)) 5981 #ifndef NeXT5982 4741 { 5983 4742 struct nlist xtra_ref; … … 5995 4754 syms_written++; 5996 4755 } 5997 #else5998 nl.n_value = assign_string_table_index (((symbol *) sp->value)->name);5999 #endif6000 4756 } 6001 4757 } 6002 6003 #ifdef MACH_O6004 if (output_file_type == IS_MACH_O)6005 generate_mach_o_symbols(buf, bufp - buf);6006 #endif6007 4758 6008 4759 /* Output the buffer full of `struct nlist's. */ … … 6103 4854 /* WRITE gets 1 for a non-global symbol that should be written. */ 6104 4855 6105 6106 4856 if (SET_ELEMENT_P (type)) /* This occurs even if global. These */ 6107 4857 /* types of symbols are never written */ … … 6137 4887 } 6138 4888 6139 #ifdef MACH_O6140 if (output_file_type == IS_MACH_O)6141 generate_mach_o_symbols(buf, bufp - buf);6142 #endif6143 6144 4889 /* All the symbols are now in BUF; write them. */ 6145 4890 … … 6272 5017 symbol_define ("__etext", N_TEXT | N_EXT, &etext_symbol_alt); 6273 5018 symbol_define ("__end", N_BSS | N_EXT, &end_symbol_alt); 6274 6275 #ifdef sun6276 {6277 symbol *dynamic_symbol;6278 symbol_define ("__DYNAMIC", N_ABS | N_EXT, &dynamic_symbol);6279 if (dynamic_symbol)6280 dynamic_symbol->value = 0;6281 }6282 #endif6283 #ifdef sequent6284 {6285 symbol *i387_flt_symbol;6286 symbol_define ("_387_flt", N_ABS | N_EXT, &i387_flt_symbol);6287 if (i387_flt_symbol)6288 i387_flt_symbol->value = 0;6289 }6290 #endif6291 #ifdef NeXT6292 {6293 symbol *shlib_init_symbol;6294 symbol_define ("__shared_library_initialization", N_UNDF | N_EXT, &shlib_init_symbol);6295 if (shlib_init_symbol)6296 shlib_init_symbol->max_common_size = sizeof (long int);6297 }6298 #endif6299 5019 } 6300 5020 … … 6351 5071 bp->undef_refs = 0; 6352 5072 bp->multiply_defined = 0; 6353 #ifdef EMX /* WEAKU */6354 5073 bp->weak = 0; 6355 #endif /* EMX */6356 5074 6357 5075 /* Add the entry to the bucket. */ … … 6445 5163 char *name; 6446 5164 { 6447 #ifndef __EMX__6448 extern int errno, sys_nerr;6449 extern char *sys_errlist[];6450 #endif /* !__EMX__ */6451 5165 char *s; 6452 5166 … … 6465 5179 struct file_entry *entry; 6466 5180 { 6467 #ifndef __EMX__6468 extern int errno, sys_nerr;6469 extern char *sys_errlist[];6470 #endif /* !__EMX__ */6471 5181 char *s; 6472 5182 … … 6590 5300 6591 5301 6592 #ifdef USG6593 6594 void6595 bzero (p, n)6596 char *p;6597 {6598 memset (p, 0, n);6599 }6600 6601 void6602 bcopy (from, to, n)6603 char *from, *to;6604 {6605 memcpy (to, from, n);6606 }6607 6608 getpagesize ()6609 {6610 return (4096);6611 }6612 6613 #endif6614 6615 #if defined(sun) && defined(sparc)6616 int6617 getpagesize ()6618 {6619 return 8192;6620 }6621 #endif6622 6623 #ifdef EMX /* demangling */6624 6625 5302 char *my_cplus_demangle (const char *mangled) 6626 5303 { … … 6629 5306 return cplus_demangle (mangled, demangle_options); 6630 5307 } 6631 6632 #endif /* EMX */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/alias/alias.smak
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 27 27 $.$(.TARG): $.$(.TKIND.DIR)c.a $.$(.TKIND.DIR)c_app.a 28 28 $(call RM,$@) 29 @$(call DO.STDALIAS,_strcasecmp,__std_stricmp,$.strcasecmp.o) 30 @$(call DO.STDALIAS,_strncasecmp,__std_strnicmp,$.strncasecmp.o) 29 31 @$(foreach x,$(ALIAS.FUNCS),\ 30 $(call DO.STDALIAS,_$x,__std_$x,$ (dir $@)$x.o)$(NL))32 $(call DO.STDALIAS,_$x,__std_$x,$.$x.o)$(NL)) 31 33 @$(foreach x,$(ALIAS._FUNCS),\ 32 $(call DO.STDALIAS,__$x,__std_$x,$(dir $@)_$x.o)$(NL)) 33 $(AR) $(ARFLAGS) $@ $(addprefix $(dir $@),\ 34 $(call DO.STDALIAS,__$x,__std_$x,$._$x.o)$(NL)) 35 $(AR) $(ARFLAGS) $@ $(addprefix $.,\ 36 strcasecmp.o strncasecmp.o \ 34 37 $(addsuffix .o,$(ALIAS.FUNCS) $(addprefix _,$(ALIAS._FUNCS)))) 35 @$(call RM,$(addprefix $(dir $@),$(addsuffix .o,$(ALIAS.FUNCS)\ 36 $(addprefix _,$(ALIAS._FUNCS))))) 38 @$(call RM,$(addprefix $., \ 39 strcasecmp.o strncasecmp.o \ 40 $(addsuffix .o,$(ALIAS.FUNCS) $(addprefix _,$(ALIAS._FUNCS))))) 37 41 38 42 include comend.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/alias/aliasfuncs.awk
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 37 37 gulp(ARGV[1]"aout/c.a"); 38 38 gulp(ARGV[1]"aout/c_app.a"); 39 gulp(ARGV[1]"aout/src/lib/startup/386/crt0.o"); 39 40 40 41 prefix = ARGV[2]; 41 42 42 43 for (x in stdfuncs) 43 if (funcs[prefix ""x] == "")44 if (funcs[prefix x] == "") 44 45 print x; 45 46 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/app/app.smak
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 1 1 .MODULE := app 2 2 .MDESC := EMX.DLL 'replacement' for statically linked programs 3 .MDEP := libc 3 4 4 5 # Build two kinds of library: aout and aout-profile. … … 7 8 .TKIND := aout 8 9 .TARGET := c_app.a 9 .TSRC .386 := src/lib/app/386/crt2.s10 .T SRC := $(.TSRC.$(CPU)) $(wildcard src/lib/app/*.c)10 .TSRC := $(wildcard src/lib/app/*.c) 11 .TCF := -I$. 11 12 .TCF.src/lib/app/stdio.c := -D_NFILES=40 12 13 .TCF.src/lib/app/iodata.c := -D_NFILES=40 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/app/stdio.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 15 15 extern int _files[]; 16 16 17 #if defined (__MT__)18 17 _rmutex _streamv_rmutex; /* See io/_newstre.c */ 19 #endif20 18 21 19 … … 27 25 struct streamvec _streamvec_head = {_streamv, NULL, _NFILES}; 28 26 29 #if defined (__MT__)30 31 27 /* If we don't preallocate the first entry, _CRT_init() will call 32 28 malloc() which breaks fork() because the heap object of the EXE … … 37 33 struct streamvec2 _streamvec2_head = {_streamv2, NULL, _NFILES}; 38 34 39 #endif40 41 35 /* The buffer for stdin. */ 42 36 … … 45 39 46 40 /* Initialize the streams -- this function will be called by 47 _ startup() via the __crtinit1__ set vector. */41 _CRT_init() via the __crtinit1__ set vector. */ 48 42 49 43 void _init_streams (void) … … 51 45 int i; 52 46 53 #if defined (__MT__)54 47 _rmutex_checked_create (&_streamv_rmutex, 0); 55 #endif56 48 57 49 for (i = 0; i < _nfiles && i < _streamvec_head.n; ++i) … … 118 110 119 111 120 /* Shutdown the streams -- this function will be called by _ cleanup()112 /* Shutdown the streams -- this function will be called by _CRT_term() 121 113 via the __crtexit1__ set vector. Do not close the streams as this 122 114 function is called by abort() and the signal handler might want to -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/atod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* atod.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <ctype.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bicmpbb.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bicmpbb.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/bigint.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bicmpp2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bicmpp2.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/bigint.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bidivbb.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* bidivbb.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <alloca.h> 4 5 #include <assert.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bidivp2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bidivp2.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <assert.h> 4 5 #include <emx/bigint.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bifls.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bifls.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <sys/builtin.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bihdivb.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bihdivb.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <assert.h> 4 5 #include <sys/builtin.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bipow5.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* bipow5.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <alloca.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bisetb.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bisetb.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <emx/bigint.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bisetd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bisetd.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/bigint.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bisetw.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bisetw.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/bigint.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bishlb.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bishlb.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/bigint.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bishlw.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bishlw.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/bigint.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/bishrb.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* bishrb.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/bigint.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/biwdivp2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* biwdivp2.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <assert.h> 4 5 #include <emx/bigint.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/conv.smak
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 libc.TSRC.386 += $(addprefix src/lib/conv/386/,biaddbb.s bidivbw.s \ 2 bidivhlp.s bimulbb.s bimulbw.s bisubmbw.s) 3 libc.TSRC += $(addprefix src/lib/conv/, atod.c atof.c atofl.c atoi.c \ 4 atol.c atoll.c dtoa.c gcvt.c itoa.c lltoa.c ltoa.c remzeros.c smalatod.c \ 5 smaldtoa.c strtod.c strtof.c strtol.c strtold.c ulltoa.c ultoa.c \ 6 bicmpbb.c bicmpp2.c bidivbb.c bidivp2.c bifls.c bihdivb.c bipow5.c \ 7 bisetb.c bisetd.c bisetw.c bishlb.c bishlw.c bishrb.c biwdivp2.c) 1 libc.TSRC.386 += $(filter-out %smallcnv.s,$(wildcard src/lib/conv/386/*.s)) 2 libc.TSRC += $(filter-out %makepow5.c,$(wildcard src/lib/conv/*.c)) 8 3 libc.TDEP += $(addprefix @O@src/lib/conv/,strtoul.o strtoll.o strtoull.o) 9 4 10 5 $(call .MVER,conv/strtoul.o): src/lib/conv/strtol.c 11 $(call DO.COMPILE.c, - DUNSIGNED)6 $(call DO.COMPILE.c, -I$. -DUNSIGNED) 12 7 $(call .MVER,conv/strtoll.o): src/lib/conv/strtol.c 13 $(call DO.COMPILE.c, - DLONG_LONG)8 $(call DO.COMPILE.c, -I$. -DLONG_LONG) 14 9 $(call .MVER,conv/strtoull.o): src/lib/conv/strtol.c 15 $(call DO.COMPILE.c, - DLONG_LONG -DUNSIGNED)10 $(call DO.COMPILE.c, -I$. -DLONG_LONG -DUNSIGNED) 16 11 17 12 .TCF.src/lib/conv/bipow5.c := -I$. … … 22 17 $.makepow5.exe: src/lib/conv/makepow5.c 23 18 $(LD) $(CFLAGS) $(CFLAGS.dbg) $(LDFLAGS.dbg) $(LDFLAGS.aout) -o $@ $< 19 20 # Build smallcnv separately (for smaller but less accurate printf()) 21 .MODULE := 22 .TKIND := aout 23 .TSRC.386 := src/lib/conv/386/smallcnv.s 24 .TSRC := $(.TSRC.$(CPU)) 25 .INSDIR := 26 include common.smak 27 28 .OBJS += $(subst /aout/,/omf/,$(patsubst %.o,%.obj,$(.OBJS))) 29 .DIRS := $(sort $(dir $(.OBJS))) 30 TARGDIRS += $(.DIRS) 31 32 libc: $(.DIRS) $(.OBJS) 33 34 INS.FILES += $(addprefix $(INS)lib/,$(notdir $(.OBJS))) 35 $(addprefix $(INS)lib/,$(notdir $(.OBJS))): $(.OBJS) 36 $(call CP,$^,$(dir $@)) 37 38 # Additional dependencies to help stupid make. 39 $.omf/src/lib/conv/386/smallcnv.obj: $.aout/src/lib/conv/386/smallcnv.o 40 41 include comend.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/dtoa.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* dtoa.c (emx+gcc) -- Copyright (c) 1996-1999 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <math.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/lltoa.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 4 4 #include <stdlib.h> 5 5 6 char *_ STD(lltoa)(long long value, char *string, int radix)6 char *_lltoa (long long value, char *string, int radix) 7 7 { 8 8 char *dst; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/ltoa.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 4 4 #include <stdlib.h> 5 5 6 char *_ STD(ltoa)(long value, char *string, int radix)6 char *_ltoa (long value, char *string, int radix) 7 7 { 8 8 char *dst; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/remzeros.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* remzeros.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <emx/float.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/smalatod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* smalatod.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <math.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/smaldtoa.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* smalldtoa.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/ulltoa.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ulltoa.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/conv/ultoa.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ultoa.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_crlf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _crlf.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fbuf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _fbuf.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _fd.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/io.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fdinit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _fdinit.c (emx+gcc) -- Copyright (c) 1996-1997 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <emx/io.h> … … 14 15 extern int _lookahead[]; 15 16 16 #if defined (__MT__)17 18 17 /* This semaphore protects a critical region in _fd_init(). */ 19 18 … … 22 21 23 22 /* Initialize the semaphore -- this function will be called by 24 _ startup() via the __crtinit1__ set vector. */23 _CRT_init() via the __crtinit1__ set vector. */ 25 24 26 25 void _init1_fdinit (void) … … 30 29 31 30 _CRT_INIT1 (_init1_fdinit) 32 33 #endif34 31 35 32 … … 81 78 p->next = NULL; 82 79 83 #if defined (__MT__)84 80 /* Prevent other threads from updating last->next. */ 85 81 … … 117 113 return _fd_init (handle); 118 114 } 119 #else120 last->next = p;121 #endif122 115 } 123 116 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fill.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _fill.c (emx+gcc) -- Copyright (c) 1990-2000 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_flush.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _flush.c (emx+gcc) -- Copyright (c) 1990-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_flushst.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _flushst.c (emx+gcc) -- Copyright (c) 1990-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fopen.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _fopen.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fseekhd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _fseekhd.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <memory.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fsetmod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _fsetmod.c (emx+gcc) -- Copyright (c) 1990-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <io.h> … … 19 20 return -1; 20 21 } 21 if ( _setmode (stream->_handle, i) == -1)22 if (setmode (stream->_handle, i) == -1) 22 23 return -1; 23 24 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_fsopen.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _fsopen.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <emx/io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_imphand.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _imphand.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <io.h> 4 5 #include <fcntl.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_input.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _input.c (emx+gcc) -- Copyright (c) 1990-2000 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> … … 10 11 #include <emx/locale.h> 11 12 #include <emx/io.h> 13 #include "getputc.h" 12 14 13 15 #define FALSE 0 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_isterm.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _isterm.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <io.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_mfopen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _mfopen.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_newstre.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _newstre.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> … … 69 70 return NULL; 70 71 } 71 72 #if defined (__MT__)73 72 74 73 int _setmore (FILE *stream, int lock) … … 141 140 } 142 141 143 #else144 145 int _setmore (FILE *stream, int lock)146 {147 stream->_mbstate = 0;148 stream->_more = NULL;149 return 0;150 }151 152 void _setdummymore (FILE *stream, struct _file2 *more)153 {154 stream->_mbstate = 0;155 stream->_more = NULL;156 }157 158 #endif159 160 161 142 void _closestream (FILE *stream) 162 143 { 163 144 if (stream->_more != NULL && stream->_more->owner == stream) 164 145 { 165 #if defined (__MT__)166 146 _rmutex_close (&stream->_more->rsem); 167 #endif168 147 stream->_more->owner = NULL; 169 148 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_output.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _output.c (emx+gcc) -- Copyright (c) 1990-2000 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> … … 12 13 #include <emx/float.h> 13 14 #include <emx/locale.h> 15 #include "getputc.h" 14 16 15 17 #define FALSE 0 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_rmtmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _rmtmp.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <sys/builtin.h> /* For <sys/fmutex.h> */ 4 5 #include <sys/fmutex.h> /* For <sys/rmutex.h> */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_seekhdr.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _seekhdr.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <memory.h> 4 5 #include <io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_str_rd.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _str_rd.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <unistd.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_str_wr.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* _str_wr.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <unistd.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_tempnam.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 2 2 /* Copyright (c) 1991-1993 by Kolja Elsaesser */ 3 3 4 #include "libc-alias.h" 4 5 #include <stdio.h> 5 6 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_tmp.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _tmp.c (emx+gcc) */ 2 2 3 #include "libc-alias.h" 3 4 #include <sys/builtin.h> /* For <sys/fmutex.h> */ 4 5 #include <sys/fmutex.h> /* For <sys/rmutex.h> */ … … 10 11 11 12 12 #if defined (__MT__)13 14 13 /* This semaphore protects _tmpidx. */ 15 14 … … 18 17 19 18 /* Initialize the semaphore -- this function will be called by 20 _ startup() via the __crtinit1__ set vector. */19 _CRT_init() via the __crtinit1__ set vector. */ 21 20 22 21 void _init1_tmp (void) … … 37 36 _rmutex_checked_release (&_tmpidx_rmutex); 38 37 } 39 40 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_tmp.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 8 8 int _tmpidxnam (char *string); 9 9 10 #if defined (__MT__)11 12 10 void _tmpidx_lock (void); 13 11 void _tmpidx_unlock (void); … … 15 13 #define TMPIDX_LOCK _tmpidx_lock () 16 14 #define TMPIDX_UNLOCK _tmpidx_unlock () 17 18 #else19 20 #define TMPIDX_LOCK21 #define TMPIDX_UNLOCK22 23 #endif /* defined (__MT__) */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_tmpbuf.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _tmpbuf.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <emx/io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_tmpidxn.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 2 2 /* Copyright (c) 1991-1993 by Kolja Elsaesser */ 3 3 4 #include "libc-alias.h" 4 5 #include <stdio.h> 5 6 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_trslash.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _trslash.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <sys/nls.h> 4 5 #include <emx/io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/_vsopen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* _vsopen.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdarg.h> 4 5 #include <io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/clearerr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* clearerr.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/ead.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ead.c (emx+gcc) -- Copyright (c) 1993-2000 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadadd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* eadadd.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadcopy.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* eadcopy.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadfea.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* eadfea.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadread.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* eadread.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #define INCL_DOSERRORS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadsort.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* eadsort.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eadwrite.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* eadwrite.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eaerrno.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* eaerrno.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #define INCL_DOSERRORS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eafree.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* eafree.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <sys/ea.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eaget.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 1 1 /* eaget.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eaput.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* eaput.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/earemove.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* earemove.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <sys/ea.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eawrite.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* eawrite.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/eof.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 21 21 if (cur < 0) 22 22 return -1; 23 len = _filelength (handle);23 len = filelength (handle); 24 24 if (len < 0) 25 25 return -1; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fassign.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* fassign.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fcloseal.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* fcloseal.c (emx+gcc) -- Copyright (c) 1990-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <emx/io.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fdopen.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 78 78 } 79 79 if (bt) 80 _setmode (handle, omode);80 setmode (handle, omode); 81 81 dst->_handle = handle; 82 82 dst->_ptr = NULL; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fgetc.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 8 8 #include <stdlib.h> 9 9 #include <emx/io.h> 10 #include "getputc.h" 10 11 11 12 int _STD(fgetc) (FILE *stream) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fgets.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 8 8 #include <stdlib.h> 9 9 #include <emx/io.h> 10 #include "getputc.h" 10 11 11 12 char *_STD(fgets) (char *buffer, int n, FILE *stream) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fputc.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 8 8 #include <stdlib.h> 9 9 #include <emx/io.h> 10 #include "getputc.h" 10 11 11 12 int _STD(fputc) (int c, FILE *stream) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/fstat.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 16 16 if (rc == 0) 17 17 { 18 if (!_tzset_flag) _tzset ();18 if (!_tzset_flag) tzset (); 19 19 _loc2gmt (&buffer->st_atime, -1); 20 20 _loc2gmt (&buffer->st_mtime, -1); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/gets.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 8 8 #include <stdlib.h> 9 9 #include <emx/io.h> 10 #include "getputc.h" 10 11 11 12 char *_STD(gets) (char *buffer) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/io.smak
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r235 r236 12 12 TARGDIRS += $(.DIRS) 13 13 14 DO.INSTALL += $(call CP,$(.OBJS) $(INS)lib/)$(NL)14 libc: $(.DIRS) $(.OBJS) 15 15 16 libc: $(.DIRS) $(.OBJS) 16 INS.FILES += $(addprefix $(INS)lib/,$(notdir $(.OBJS))) 17 $(addprefix $(INS)lib/,$(notdir $(.OBJS))): $(.OBJS) 18 $(call CP,$^,$(dir $@)) 17 19 18 20 include comend.smak -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/popen.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 49 49 return NULL; 50 50 } 51 f = _fdopen (pipe_local, mode);51 f = fdopen (pipe_local, mode); 52 52 if (f == NULL) 53 53 { … … 66 66 } 67 67 base = _getname (sh); 68 if ( _stricmp (base, "cmd.exe") == 0 || _stricmp (base, "4os2.exe") == 0)68 if (stricmp (base, "cmd.exe") == 0 || stricmp (base, "4os2.exe") == 0) 69 69 opt = "/c"; 70 70 else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/puts.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 9 9 #include <string.h> 10 10 #include <emx/io.h> 11 #include "getputc.h" 11 12 12 13 int _STD(puts) (const char *string) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/sopen.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #include <emx/io.h> 7 7 8 int _ STD(sopen)(const char *name, int oflag, int shflag, ...)8 int _sopen (const char *name, int oflag, int shflag, ...) 9 9 { 10 10 va_list va; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/stat.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 40 40 return -1; 41 41 } 42 if (!_tzset_flag) _tzset ();42 if (!_tzset_flag) tzset (); 43 43 _loc2gmt (&buffer->st_atime, -1); 44 44 _loc2gmt (&buffer->st_mtime, -1); … … 48 48 tmp = _getext (name); 49 49 if (tmp != NULL && 50 ( _stricmp (tmp, ".exe") == 0 ||51 _stricmp (tmp, ".com") == 0 ||52 _stricmp (tmp, ".cmd") == 0 ||53 _stricmp (tmp, ".bat") == 0))50 (stricmp (tmp, ".exe") == 0 || 51 stricmp (tmp, ".com") == 0 || 52 stricmp (tmp, ".cmd") == 0 || 53 stricmp (tmp, ".bat") == 0)) 54 54 buffer->st_mode |= (S_IEXEC >> 6) * 0111; 55 55 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/tmpfile.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 29 29 if (fd == -1) 30 30 return NULL; 31 f = _fdopen (fd, "w+b");31 f = fdopen (fd, "w+b"); 32 32 if (f == NULL) 33 33 return NULL; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/tmpnam.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 10 10 char *_STD(tmpnam) (char *string) 11 11 { 12 #if defined (__MT__)13 12 struct _thread *tp = _thread (); 14 #define tnbuf (tp->_th_tmpnam_buf)15 #else16 static char tnbuf[L_tmpnam];17 #endif18 13 19 if (string == NULL) string = tnbuf; 14 if (string == NULL) 15 string = tp->_th_tmpnam_buf; 20 16 if (_tmpidxnam (string) >= 0) 21 17 return string; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/ttyname.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 8 8 char *_STD(ttyname) (int handle) 9 9 { 10 #if defined (__MT__)11 10 struct _thread *tp = _thread (); 12 #define buf (tp->_th_ttyname)13 #else14 static char buf[32];15 #endif16 11 17 if (__ttyname (handle, buf, sizeof (buf)) == 0)18 return buf;12 if (__ttyname (handle, tp->_th_ttyname, sizeof (tp->_th_ttyname)) == 0) 13 return tp->_th_ttyname; 19 14 else 20 15 return NULL; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/utime.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 25 25 tv[1].tv_usec = 0; 26 26 } 27 if (!_tzset_flag) _tzset ();27 if (!_tzset_flag) tzset (); 28 28 tmp = tv[0].tv_sec; _gmt2loc (&tmp); tv[0].tv_sec = tmp; 29 29 tmp = tv[1].tv_sec; _gmt2loc (&tmp); tv[1].tv_sec = tmp; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/io/utimes.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 22 22 tv[1] = tvp[1]; 23 23 } 24 if (!_tzset_flag) _tzset ();24 if (!_tzset_flag) tzset (); 25 25 tmp = tv[0].tv_sec; _gmt2loc (&tmp); tv[0].tv_sec = tmp; 26 26 tmp = tv[1].tv_sec; _gmt2loc (&tmp); tv[1].tv_sec = tmp; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/libc.smak
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r235 r236 11 11 LIBC.SUBMAK := $(wildcard src/lib/*/*.smak) 12 12 -include $(LIBC.SUBMAK) 13 # Add to the list of genrules.smak dependencies 14 $.genrules.smak: $(LIBC.SUBMAK) 13 15 14 $(OUT)genrules.smak: $(LIBC.SUBMAK) 16 # First of all, libc target needs the libc-std.h file generated. 17 # If we depend directly on the header file, it is a pain since every 18 # time a .c file is modified, the .h file is regenerated, and then 19 # every source file is recompiled (since libc-std.h is included from 20 # every libc source file). To avoid this, we create a stamp file which 21 # takes care not to update libc-std.h if it has not been changed. 22 libc: $.stmp-libc-std 15 23 16 24 .MODULE := libc … … 21 29 .TSRC := $(libc.TSRC.$(CPU)) $(libc.TSRC) 22 30 .TDEP := $(libc.TDEP.$(CPU)) $(libc.TDEP) 31 .TCF := -I$. 23 32 .INSDIR = lib/ 24 33 .TKEEP := 1 … … 35 44 #------------------------------------------------------ 36 45 LIBC.DLL = $.aout/libc$(VH)$(VM).dll 46 LIBC.IMPLIB = $.aout/c_dll.a $.omf/c_dll.lib 37 47 38 48 DO.HELP.MODULES += $(call ECHO, libc-dll - The dynamic C library (.dll))$(NL) 39 49 40 DO.INSTALL += $(call CP,$(LIBC.DLL),$(INS)dll/)$(NL) 41 INSDIRS += $(INS)dll/ 50 INS.FILES += $(INS)dll/$(notdir $(LIBC.DLL)) \ 51 $(addprefix $(INS)lib/,$(notdir $(LIBC.IMPLIB))) 52 53 $(INS)dll/$(notdir $(LIBC.DLL)): $(LIBC.DLL) 54 $(call CP,$<,$@) 55 $(addprefix $(INS)lib/,$(notdir $(LIBC.IMPLIB))): $(LIBC.IMPLIB) 56 $(call CP,$^,$(dir $@)) 42 57 43 58 .PHONY: libc-dll 44 59 all: libc-dll 45 libc-dll: $(EMXEXP.DEPON) $(EMXBIND.DEPON) $(EMXIMP.DEPON) app alias libc os2 $(LIBC.DLL)60 libc-dll: emxbind emxexp app alias libc os2 $(LIBC.DLL) $(LIBC.IMPLIB) 46 61 47 62 $(LIBC.DLL): $.aout/src/lib/startup/386/dll0.o $(.OBJS) $(.DEPS) \ … … 52 67 @$(call RM,__libc__) 53 68 69 $(LIBC.IMPLIB): $.aout/libc.def 70 emximp -o $@ $< 71 54 72 $.aout/libc.def: $.aout/c.a $.aout/c_app.a 55 73 $(call RM,$@) … … 58 76 @$(call FECHO,$@,EXPORTS) 59 77 @$(call DO.EMXEXP) 78 79 # How libc-std.h can be auto-generated. 80 # Unfortunately, we cannot use c.a to find out all _std_ names since 81 # c.a itself depends on this header file. Thus we have to scan all source 82 # files for _STD() macros invocations. Fortunately, gawk rulez forever thus 83 # this happens in just a fraction of second. 84 $.stmp-libc-std: $(wildcard src/lib/*/*.c src/lib/*/386/*.s) 85 gawk -f src/lib/mkstd.awk $^ >__tmp__ 86 $(call UPDATE,__tmp__,$.libc-std.h) 87 $(call TOUCH,$@) 60 88 61 89 # Forget temporary variables -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/locale/setlocal.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 224 224 225 225 for (dp = _lc_table; dp->name != NULL; ++dp) 226 if ( _stricmp (dp->name, locale) == 0)226 if (stricmp (dp->name, locale) == 0) 227 227 return dp; 228 228 return NULL; … … 344 344 that locale. */ 345 345 346 if ( _stricmp (lcn_collate, lcn_ctype) == 0347 && _stricmp (lcn_collate, lcn_monetary) == 0348 && _stricmp (lcn_collate, lcn_numeric) == 0349 && _stricmp (lcn_collate, lcn_time) == 0)346 if (stricmp (lcn_collate, lcn_ctype) == 0 347 && stricmp (lcn_collate, lcn_monetary) == 0 348 && stricmp (lcn_collate, lcn_numeric) == 0 349 && stricmp (lcn_collate, lcn_time) == 0) 350 350 return lcn_collate; 351 351 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/defalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* defalloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 29 30 30 31 saved_errno = errno; 31 rest = _ulimit (UL_OBJREST, 0); /* The 2nd arg isn't required */32 rest = ulimit (UL_OBJREST, 0); /* The 2nd arg isn't required */ 32 33 errno = saved_errno; 33 34 if (rest != -1 && rest != 0 && n > (size_t)rest) … … 54 55 requested memory allocation to the next call. */ 55 56 56 p = _sbrk ((int)rest);57 p = sbrk ((int)rest); 57 58 if (p == (void *)-1) 58 59 return NULL; … … 64 65 /* Allocate memory. */ 65 66 66 p = _sbrk (n);67 p = sbrk (n); 67 68 if (p == (void *)-1) 68 69 { 69 70 n = *size; 70 p = _sbrk (n);71 p = sbrk (n); 71 72 if (p == (void *)-1) 72 73 return NULL; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/defexpan.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* defexpan.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 15 16 size_t n; 16 17 17 if (_UM_ADD (base, old_size) != _sbrk (0))18 if (_UM_ADD (base, old_size) != sbrk (0)) 18 19 return 0; 19 20 n = (*new_size - old_size + 0xffff) & ~0xffff; 20 p = _sbrk (n);21 p = sbrk (n); 21 22 if (p == (void *)-1) 22 23 { 23 24 n = *new_size - old_size; 24 p = _sbrk (n);25 p = sbrk (n); 25 26 if (p == (void *)-1) 26 27 return 0; … … 28 29 if (p != _UM_ADD (base, old_size)) 29 30 { 30 _sbrk (-n);31 sbrk (-n); 31 32 return 0; 32 33 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/defrelea.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* defrelea.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 13 14 void *cur; 14 15 15 cur = _sbrk (0);16 cur = sbrk (0); 16 17 if (_UM_ADD (memory, size) == cur) 17 _sbrk (-size);18 sbrk (-size); 18 19 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/defshrin.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* defshrink.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 14 15 void *cur; 15 16 16 cur = _sbrk (0);17 cur = sbrk (0); 17 18 if (_UM_ADD (memory, old_size) != cur 18 || _sbrk ((int)(*new_size - old_size)) == (void *)-1)19 || sbrk ((int)(*new_size - old_size)) == (void *)-1) 19 20 *new_size = old_size; 20 21 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/heapchk.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* heapchk.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/heapmin.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* heapmin.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/heapset.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* heapset.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/heapwalk.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* heapwalk.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/iaddmem.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* iaddmem.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/ialloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ialloc.c (emx+gcc) -- Copyright (c) 1996-1999 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/ifree.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ifree.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/imisc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* imisc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/initr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* initr.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 35 36 { 36 37 _uflags (_UF_SBRK_MODEL, _UF_SBRK_ARBITRARY); 37 memory = _sbrk (_INITIAL_DEFAULT_HEAP_SIZE);38 memory = sbrk (_INITIAL_DEFAULT_HEAP_SIZE); 38 39 if (memory == (void *)-1) 39 40 abort (); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/initt.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* initt.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 15 16 16 17 Heap_t _um_tiled_heap = NULL; 17 18 19 /* This is an attempt at provoking a linker error if malloc() has been20 replaced and -ltmalloc has been forgotten. By referencing the21 _emx_tmalloc_magic() function, we force in the module compiled from22 malloc.c. That will hopefully conflict with the replacement23 malloc(). Note that the symbol must actually be used; we do this24 by calling the function. */25 26 extern void _emx_tmalloc_magic (void);27 18 28 19 … … 43 34 { 44 35 /* Use the regular heap also as tiled heap. */ 45 46 _emx_tmalloc_magic ();47 36 _um_init_default_regular_heap (); 48 37 _um_tiled_heap = _um_regular_heap; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/irealloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* irealloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/iwalk.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* iwalk.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/malloc.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 19 19 return _umalloc (_UM_DEFAULT_REGULAR_HEAP, size); 20 20 } 21 22 /* See initt.c */23 24 void _emx_tmalloc_magic (void)25 {26 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/mheap.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* mheap.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/msize.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* msize.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/tcalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* tcalloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/tfree.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* tfree.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/theapmin.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* theapmin.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/tmalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* tmalloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/trealloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* trealloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uaddmem.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uaddmem.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/ucalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ucalloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uclose.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uclose.c (emx+gcc) -- Copyright (c) 1996-1997 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 14 15 || h == _um_regular_heap || h == _um_tiled_heap) 15 16 return -1; 16 #if defined (__MT__)17 17 _rmutex_close (&h->rsem); 18 #endif19 18 return 0; 20 19 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/ucreate.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ucreate.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/ucreate2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ucreate2.c (emx+gcc) -- Copyright (c) 1996-1997 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 76 77 77 78 /* Initialize the mutex semaphore. */ 78 79 #if defined (__MT__)80 79 if (_rmutex_create (&h->rsem, (type & _HEAP_SHARED) ? _FMC_SHARED : 0) != 0) 81 80 return NULL; 82 #endif83 81 84 82 /* The heap has been created, except for the initial segment. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/udefault.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* udefault.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/udestroy.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* udestroy.c (emx+gcc) -- Copyright (c) 1996-1997 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 88 89 decrements the open count to 0, destroying the semaphore. */ 89 90 90 #if defined (__MT__)91 91 _rmutex_close (&h->rsem); 92 #endif93 92 return 0; 94 93 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uheapchk.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uheapchk.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uheapmin.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uheapmin.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uheapset.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uheapset.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/umalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* umalloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uopen.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uopen.c (emx+gcc) -- Copyright (c) 1996-1997 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> … … 14 15 || h == _um_regular_heap || h == _um_tiled_heap) 15 16 return -1; 16 #if defined (__MT__)17 17 if (_rmutex_open (&h->rsem) != 0) 18 18 return -1; 19 #endif20 19 return 0; 21 20 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/ustats.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* ustats.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/utcalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* utcalloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/utdefaul.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* utdefaul.c (emx+gcc) -- Copyright (c) 1996-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/utmalloc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* utmalloc.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/utype.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* utype.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uwalk.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uwalk.c (emx+gcc) -- Copyright (c) 1996-2000 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/malloc/uwalk2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* uwalk2.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <stddef.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/acos.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX1(acos) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 17 17 #define x 4(%esp) 18 18 19 LABEL(FUNC):19 FUNC: 20 20 PROFILE_NOFRAME 21 21 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/asin.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX1(asin) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 17 17 #define x 4(%esp) 18 18 19 LABEL(FUNC):19 FUNC: 20 20 PROFILE_NOFRAME 21 21 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/atan.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX1(atan) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 15 15 #define x 4(%esp) 16 16 17 LABEL(FUNC):17 FUNC: 18 18 PROFILE_NOFRAME 19 19 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/atan2.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX1(atan2) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 20 20 #endif 21 21 22 LABEL(FUNC):22 FUNC: 23 23 PROFILE_NOFRAME 24 24 FLD y /* y */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/ceil.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(ceil) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define x 8(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 subl $4, %esp -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/clear.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl LABEL(_clear87)5 .globl __clear87 6 6 7 7 .text … … 11 11 / unsigned _clear87 (void) 12 12 13 LABEL(_clear87):13 __clear87: 14 14 PROFILE_NOFRAME 15 15 xor %eax, %eax /* Clear upper 16 bits */ 16 16 fstsw %ax 17 17 fclex 18 EPILOGUE(_ clear87)18 EPILOGUE(__clear87) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/control.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl LABEL(_control87)5 .globl __control87 6 6 7 7 .text … … 17 17 #define mask 12(%esp) 18 18 19 LABEL(_control87):19 __control87: 20 20 PROFILE_NOFRAME 21 21 pushl %ecx /* Dummy (for control word) */ … … 33 33 1: popl %eax /* Return old cw in lower 16 bits */ 34 34 movzwl %ax, %eax /* Clear upper 16 bits */ 35 EPILOGUE(_ control87)35 EPILOGUE(__control87) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/copysig.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX2(copysign) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define y(i) 16+i(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 movb y(9), %al … … 34 34 #define y(i) 8+i(%esp) 35 35 36 LABEL(FUNC):36 FUNC: 37 37 PROFILE_NOFRAME 38 38 movb y(3), %al … … 50 50 #define y(i) 12+i(%esp) 51 51 52 LABEL(FUNC):52 FUNC: 53 53 PROFILE_NOFRAME 54 54 movb y(7), %al -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/cos.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #define FUNC MATHSUFFIX1(cos) 7 7 8 .globl LABEL(FUNC)8 .globl FUNC 9 9 10 10 .text … … 16 16 #define x 4(%esp) 17 17 18 LABEL(FUNC):18 FUNC: 19 19 PROFILE_NOFRAME 20 20 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/cosh.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(cosh) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 20 20 / cosh(x) = 0.5 * (exp(x) + exp(-x)) = 0.5 * (exp(x) + 1/exp(-x)) 21 21 22 LABEL(FUNC):22 FUNC: 23 23 PROFILE_NOFRAME 24 24 subl $4, %esp /* space for control words */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/exp.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(exp) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define x 8(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 subl $4, %esp /* space for control words */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/fabs.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX1(fabs) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 15 15 #define x 4(%esp) 16 16 17 LABEL(FUNC):17 FUNC: 18 18 PROFILE_NOFRAME 19 19 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/floor.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(floor) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define x 8(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 subl $4, %esp -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/fmod.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #define FUNC MATHSUFFIX1(fmod) 7 7 8 .globl LABEL(FUNC)8 .globl FUNC 9 9 10 10 .text … … 22 22 #endif 23 23 24 LABEL(FUNC):24 FUNC: 25 25 PROFILE_NOFRAME 26 26 FLD y /* y */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/fpclass.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX3(__fpclassify) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 17 17 #define x 4(%esp) 18 18 19 LABEL(FUNC):19 FUNC: 20 20 PROFILE_NOFRAME 21 21 fldt x … … 58 58 #define x 4(%esp) 59 59 60 LABEL(FUNC):60 FUNC: 61 61 PROFILE_NOFRAME 62 62 movl x, %edx … … 84 84 #define x4 8(%esp) 85 85 86 LABEL(FUNC):86 FUNC: 87 87 PROFILE_NOFRAME 88 88 movl x4, %edx -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/fpreset.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl LABEL(_fpreset)5 .globl __fpreset 6 6 7 7 .text … … 11 11 / void _fpreset (void) 12 12 13 LABEL(_fpreset):13 __fpreset: 14 14 PROFILE_NOFRAME 15 15 finit 16 EPILOGUE(_ fpreset)16 EPILOGUE(__fpreset) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/frexp.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #define FUNC MATHSUFFIX1(frexp) 7 7 8 .globl LABEL(FUNC)8 .globl FUNC 9 9 10 10 .text … … 21 21 #endif 22 22 23 LABEL(FUNC):23 FUNC: 24 24 PROFILE_NOFRAME 25 25 movl exp_ptr, %edx -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/fxam.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX2(fxam) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 16 16 #define x 4(%esp) 17 17 18 LABEL(FUNC):18 FUNC: 19 19 PROFILE_NOFRAME 20 20 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/hypot.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 9 9 #define FUNC MATHSUFFIX2(hypot) 10 10 11 .globl LABEL(FUNC)11 .globl FUNC 12 12 13 13 .text … … 24 24 #endif 25 25 26 LABEL(FUNC):26 FUNC: 27 27 PROFILE_NOFRAME 28 28 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/isfin.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX3(__isfinite) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 17 17 #define x 4(%esp) 18 18 19 LABEL(FUNC):19 FUNC: 20 20 PROFILE_NOFRAME 21 21 fldt x … … 58 58 #define x 4(%esp) 59 59 60 LABEL(FUNC):60 FUNC: 61 61 PROFILE_NOFRAME 62 62 movl x, %edx … … 74 74 #define x4 8(%esp) 75 75 76 LABEL(FUNC):76 FUNC: 77 77 PROFILE_NOFRAME 78 78 movl x4, %edx -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/isnan.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX3(__isnan) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 17 17 #define x 4(%esp) 18 18 19 LABEL(FUNC):19 FUNC: 20 20 PROFILE_NOFRAME 21 21 fldt x … … 58 58 #define x 4(%esp) 59 59 60 LABEL(FUNC):60 FUNC: 61 61 PROFILE_NOFRAME 62 62 movl x, %edx … … 74 74 #define x4 8(%esp) 75 75 76 LABEL(FUNC):76 FUNC: 77 77 PROFILE_NOFRAME 78 78 movl x4, %edx -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/isnorm.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX3(__isnormal) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 17 17 #define x 4(%esp) 18 18 19 LABEL(FUNC):19 FUNC: 20 20 PROFILE_NOFRAME 21 21 fldt x … … 35 35 #define x 4(%esp) 36 36 37 LABEL(FUNC):37 FUNC: 38 38 PROFILE_NOFRAME 39 39 movl x, %edx … … 52 52 #define x4 8(%esp) 53 53 54 LABEL(FUNC):54 FUNC: 55 55 PROFILE_NOFRAME 56 56 movl x4, %edx -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/ldexp.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX1(ldexp) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 20 20 #endif 21 21 22 LABEL(FUNC):22 FUNC: 23 23 PROFILE_NOFRAME 24 24 fildl exp /* exp */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/log.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(log) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 15 15 #define x 4(%esp) 16 16 17 LABEL(FUNC):17 FUNC: 18 18 PROFILE_NOFRAME 19 19 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/log10.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(log10) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 15 15 #define x 4(%esp) 16 16 17 LABEL(FUNC):17 FUNC: 18 18 PROFILE_NOFRAME 19 19 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/modf.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(modf) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 23 23 #endif 24 24 25 LABEL(FUNC):25 FUNC: 26 26 PROFILE_NOFRAME 27 27 subl $4, %esp -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/nextaft.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX2(nextafter) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define y(i) 16+i(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 fldt x(0) … … 161 161 #define y 8(%esp) 162 162 163 LABEL(FUNC):163 FUNC: 164 164 PROFILE_NOFRAME 165 165 flds x … … 238 238 #define y(i) 12+i(%esp) 239 239 240 LABEL(FUNC):240 FUNC: 241 241 PROFILE_NOFRAME 242 242 fldl x(0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/pow.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #define FUNC MATHSUFFIX1(pow) 7 7 8 .globl LABEL(FUNC)8 .globl FUNC 9 9 10 10 .text … … 25 25 #endif 26 26 27 LABEL(FUNC):27 FUNC: 28 28 pushl %ebp 29 29 movl %esp, %ebp -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/rint.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX2(rint) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define x 8(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 subl $4, %esp -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/signbit.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX3(__signbit) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define x9 13(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 xorl %eax, %eax … … 32 32 #define x3 7(%esp) 33 33 34 LABEL(FUNC):34 FUNC: 35 35 PROFILE_NOFRAME 36 36 xorl %eax, %eax … … 46 46 #define x7 11(%esp) 47 47 48 LABEL(FUNC):48 FUNC: 49 49 PROFILE_NOFRAME 50 50 xorl %eax, %eax -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/sin.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #define FUNC MATHSUFFIX1(sin) 7 7 8 .globl LABEL(FUNC)8 .globl FUNC 9 9 10 10 .text … … 16 16 #define x 4(%esp) 17 17 18 LABEL(FUNC):18 FUNC: 19 19 PROFILE_NOFRAME 20 20 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/sinh.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(sinh) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 20 20 / sinh(x) = 0.5 * (exp(x) - exp(-x)) = 0.5 * (exp(x) - 1/exp(x)) 21 21 22 LABEL(FUNC):22 FUNC: 23 23 PROFILE_NOFRAME 24 24 subl $4, %esp /* space for control words */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/sqrt.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 5 5 #define FUNC MATHSUFFIX1(sqrt) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 15 15 #define x 4(%esp) 16 16 17 LABEL(FUNC):17 FUNC: 18 18 PROFILE_NOFRAME 19 19 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/status.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl LABEL(_status87)5 .globl __status87 6 6 7 7 .text … … 11 11 / unsigned _status87 (void) 12 12 13 LABEL(_status87):13 __status87: 14 14 PROFILE_NOFRAME 15 15 xor %eax, %eax /* Clear upper 16 bits */ 16 16 fstsw %ax 17 EPILOGUE(_ status87)17 EPILOGUE(__status87) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/tan.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #define FUNC MATHSUFFIX1(tan) 7 7 8 .globl LABEL(FUNC)8 .globl FUNC 9 9 10 10 .text … … 16 16 #define x 4(%esp) 17 17 18 LABEL(FUNC):18 FUNC: 19 19 PROFILE_NOFRAME 20 20 FLD x /* x */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/tanh.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX1(tanh) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 20 20 / tanh(x) = (t-1.0) / (t+1.0) with t = exp (2.0 * x) 21 21 22 LABEL(FUNC):22 FUNC: 23 23 PROFILE_NOFRAME 24 24 subl $4, %esp /* space for control words */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/386/trunc.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #define FUNC MATHSUFFIX2(trunc) 6 6 7 .globl LABEL(FUNC)7 .globl FUNC 8 8 9 9 .text … … 18 18 #define x 8(%esp) 19 19 20 LABEL(FUNC):20 FUNC: 21 21 PROFILE_NOFRAME 22 22 subl $4, %esp -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/math/math.smak
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 10 10 sinl.o sinhl.o sqrtl.o tanl.o tanhl.o truncl.o) 11 11 12 # bird: .s files are in math/386 not math. 13 # And besides the call doesn't work correctly 14 # <rant>Pitty gnu make doesn have .for like BSD make have, that one actually 15 # can generate rules on the fly :) </rant> 16 # 17 #$(call .MVER,math/%f.o): src/lib/math/386/%.s 18 # $(call DO.COMPILE.s, -DFLOAT) 19 #$(call .MVER,math/%l.o): src/lib/math/386/%.s 20 # $(call DO.COMPILE.s, -DLONG_DOUBLE) 21 22 $.aout/src/lib/math/386/%f.o: src/lib/math/386/%.s 12 $(call .MVER,math/386/%f.o): src/lib/math/386/%.s 23 13 $(call DO.COMPILE.s, -DFLOAT) 24 $ .aout/src/lib/math/386/%l.o: src/lib/math/386/%.s14 $(call .MVER,math/386/%l.o): src/lib/math/386/%.s 25 15 $(call DO.COMPILE.s, -DLONG_DOUBLE) 26 $.aout-prof/src/lib/math/386/%f.o: src/lib/math/386/%.s27 $(call DO.COMPILE.s, -DFLOAT)28 $.aout-prof/src/lib/math/386/%l.o: src/lib/math/386/%.s29 $(call DO.COMPILE.s, -DLONG_DOUBLE)30 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/mblen.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #include <emx/locale.h> 7 7 8 #if defined (__MT__)9 #define shift tp->_th_mblen_shift10 #else11 static int shift = 0;12 #endif13 14 15 8 int _STD(mblen) (const char *s, size_t n) 16 9 { 17 #if defined (__MT__)18 10 struct _thread *tp = _thread (); 19 #endif20 11 21 12 if (s == NULL) … … 23 14 if (_cur_mbyte.mode == _MB_SHIFT) 24 15 { 25 shift = 0;16 tp->_th_mblen_shift = 0; 26 17 return 1; /* State dependency */ 27 18 } … … 29 20 return 0; /* No state dependency */ 30 21 } 31 return _mbtowc (NULL, s, n, & shift);22 return _mbtowc (NULL, s, n, &tp->_th_mblen_shift); 32 23 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/mbtowc.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 6 6 #include <emx/locale.h> 7 7 8 #if defined (__MT__)9 #define shift tp->_th_mbtowc_shift10 #else11 static int shift = 0;12 #endif13 14 15 8 int _STD(mbtowc) (wchar_t *pwc, const char *s, size_t n) 16 9 { 17 #if defined (__MT__)18 10 struct _thread *tp = _thread (); 19 #endif20 11 21 12 if (s == NULL) … … 23 14 if (_cur_mbyte.mode == _MB_SHIFT) 24 15 { 25 shift = 0;16 tp->_th_mbtowc_shift = 0; 26 17 return 1; /* State dependency */ 27 18 } … … 29 20 return 0; /* No state dependency */ 30 21 } 31 return _mbtowc (pwc, s, n, & shift);22 return _mbtowc (pwc, s, n, &tp->_th_mbtowc_shift); 32 23 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/mbyte/wctomb.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 7 7 #include <emx/locale.h> 8 8 9 #if defined (__MT__)10 #define shift (tp->_th_wctomb_shift)11 #else12 static int shift = 0;13 #endif14 15 9 int _STD(wctomb) (char *s, wchar_t wchar) 16 10 { 17 #if defined (__MT__)18 11 struct _thread *tp = _thread (); 19 #endif20 12 21 13 if (s == NULL) … … 23 15 if (_cur_mbyte.mode == _MB_SHIFT) 24 16 { 25 shift = 0;17 tp->_th_wctomb_shift = 0; 26 18 return 1; /* State dependency */ 27 19 } … … 29 21 return 0; /* No state dependency */ 30 22 } 31 return _wctomb (s, wchar, MB_LEN_MAX, & shift);23 return _wctomb (s, wchar, MB_LEN_MAX, &tp->_th_wctomb_shift); 32 24 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/386/div.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ div, _ldiv5 .globl _STD(div), _STD(ldiv) 6 6 7 7 .text … … 11 11 / ldiv_t ldiv (long num, long den) 12 12 13 _ ldiv:14 _ div:13 _STD(ldiv): 14 _STD(div): 15 15 PROFILE_NOFRAME 16 16 movl 1*4(%esp), %eax /* num */ 17 17 cltd /* sign extension */ 18 18 idivl 2*4(%esp) /* den */ 19 EPILOGUE( div)19 EPILOGUE(_STD(div)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/386/setjmp.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ setjmp, _longjmp5 .globl _STD(setjmp), _STD(longjmp) 6 6 7 7 .text … … 20 20 / int setjmp (jmp_buf here) 21 21 22 _ setjmp:22 _STD(setjmp): 23 23 PROFILE_NOFRAME 24 24 movl 1*4(%esp), %edx /* here */ … … 34 34 movl %eax, J_XCP(%edx) 35 35 xorl %eax, %eax 36 EPILOGUE( setjmp)36 EPILOGUE(_STD(setjmp)) 37 37 38 38 ALIGN … … 40 40 / void longjmp (jmp_buf there, int n) 41 41 42 _ longjmp:42 _STD(longjmp): 43 43 PROFILE_NOFRAME 44 44 movl 1*4(%esp), %eax /* there */ … … 58 58 movl J_EIP(%edx), %edx 59 59 movl %edx, 0*4(%esp) /* return address */ 60 EPILOGUE( longjmp)/* well, ... */60 EPILOGUE(_STD(longjmp)) /* well, ... */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/abort.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 14 14 15 15 /* Special handling if there's a signal-catching function installed 16 and SIGABRT is not blocked: do not yet call _ cleanup(). */16 and SIGABRT is not blocked: do not yet call _CRT_term(). */ 17 17 18 18 if (sigaction (SIGABRT, NULL, &act) == 0 … … 38 38 39 39 if (abort_flag++ == 0) 40 _ cleanup();40 _CRT_term (); 41 41 42 42 /* Unblock SIGABRT. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/abspath.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* abspath.c (emx+gcc) -- Copyright (c) 1992-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/assert.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 3 3 #undef NDEBUG 4 4 5 #include "libc-alias.h" 5 6 #include <assert.h> 6 7 #include <stdio.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/chdir2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* chdir2.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/defext.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* defext.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/dtread.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* dtread.c (emx+gcc) -- Copyright (c) 1987-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> … … 164 165 int len, saved_errno; 165 166 166 if (!_tzset_flag) _tzset ();167 if (!_tzset_flag) tzset (); 167 168 data.dir = dir; 168 169 data.mask = mask; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/dtsort.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* dtsort.c (emx+gcc) -- Copyright (c) 1987-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/dtsplit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* dtsplit.c (emx+gcc) -- Copyright (c) 1987-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/envargs.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* envargs.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fnexplod.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* fnexplod.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fngetdrv.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* fngetdrv.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fnisabs.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* fnisabs.c (emx+gcc) -- Copyright (c) 1992-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <ctype.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fnisrel.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* fnisrel.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <ctype.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fnslashi.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* fnslashi.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <sys/nls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/fullpath.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* fullpath.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getcwd1.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* getcwd1.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getcwd2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* getcwd2.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getegid.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* getegid.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <unistd.h> 4 5 #include <sys/types.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/geteuid.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* geteuid.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <unistd.h> 4 5 #include <sys/types.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getext.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* getext.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getext2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* getext2.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getgrgid.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* getgrgid.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <sys/types.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getname.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 13 13 /* Note: This function is used by emx.dll. */ 14 14 15 char *_ STD(getname)(const char *path)15 char *_getname (const char *path) 16 16 { 17 17 const char *p; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getopt.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 1 1 /* getopt.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> … … 6 7 #include <emx/getopt.h> 7 8 8 char * _optarg = NULL;9 int _optind = 1; /* Default: first call */10 int _opterr = 1; /* Default: error messages enabled */11 char * _optswchar = "-"; /* Default: '-' starts options */12 enum _optmode _optmode = GETOPT_UNIX;13 int _optopt;9 char *optarg = NULL; 10 int optind = 1; /* Default: first call */ 11 int opterr = 1; /* Default: error messages enabled */ 12 char *optswchar = "-"; /* Default: '-' starts options */ 13 enum _optmode optmode = GETOPT_UNIX; 14 int optopt; 14 15 15 16 static char * next_opt; /* Next character in cluster of options */ … … 28 29 29 30 #define PUT(dst) BEGIN \ 30 if ( _optmode == GETOPT_ANY) \31 dst[dst##_count++] = argv[ _optind]; \31 if (optmode == GETOPT_ANY) \ 32 dst[dst##_count++] = argv[optind]; \ 32 33 END 33 34 34 35 /* Note: `argv' is not const as GETOPT_ANY reorders argv[]. */ 35 36 36 int _ getopt(int argc, char * argv[], const char *opt_str)37 int _STD(getopt) (int argc, char * argv[], const char *opt_str) 37 38 { 38 39 char c, *q; 39 40 int i, j; 40 41 41 if (!init || _optind == 0)42 if (!init || optind == 0) 42 43 { 43 if ( _optind == 0) _optind = 1;44 if (optind == 0) optind = 1; 44 45 done = 0; init = 1; 45 46 next_opt = ""; 46 if ( _optmode == GETOPT_ANY)47 if (optmode == GETOPT_ANY) 47 48 { 48 49 options = (char **)malloc (argc * sizeof (char *)); … … 59 60 return -1; 60 61 restart: 61 _optarg = NULL;62 optarg = NULL; 62 63 if (*next_opt == 0) 63 64 { 64 if ( _optind >= argc)65 if (optind >= argc) 65 66 { 66 if ( _optmode == GETOPT_ANY)67 if (optmode == GETOPT_ANY) 67 68 { 68 69 j = 1; … … 71 72 for (i = 0; i < non_options_count; ++i) 72 73 argv[j++] = non_options[i]; 73 _optind = options_count+1;74 optind = options_count+1; 74 75 free (options); free (non_options); 75 76 } … … 77 78 return -1; 78 79 } 79 else if (!strchr ( _optswchar, argv[_optind][0]) || argv[_optind][1] == 0)80 else if (!strchr (optswchar, argv[optind][0]) || argv[optind][1] == 0) 80 81 { 81 if ( _optmode == GETOPT_UNIX)82 if (optmode == GETOPT_UNIX) 82 83 { 83 84 done = 1; … … 85 86 } 86 87 PUT (non_options); 87 _optarg = argv[_optind++];88 if ( _optmode == GETOPT_ANY)88 optarg = argv[optind++]; 89 if (optmode == GETOPT_ANY) 89 90 goto restart; 90 /* _optmode==GETOPT_KEEP */91 /* optmode==GETOPT_KEEP */ 91 92 return 0; 92 93 } 93 else if (argv[ _optind][0] == argv[_optind][1] && argv[_optind][2] == 0)94 else if (argv[optind][0] == argv[optind][1] && argv[optind][2] == 0) 94 95 { 95 if ( _optmode == GETOPT_ANY)96 if (optmode == GETOPT_ANY) 96 97 { 97 98 j = 1; 98 99 for (i = 0; i < options_count; ++i) 99 100 argv[j++] = options[i]; 100 argv[j++] = argv[ _optind];101 argv[j++] = argv[optind]; 101 102 for (i = 0; i < non_options_count; ++i) 102 103 argv[j++] = non_options[i]; 103 for (i = _optind+1; i < argc; ++i)104 for (i = optind+1; i < argc; ++i) 104 105 argv[j++] = argv[i]; 105 _optind = options_count+2;106 optind = options_count+2; 106 107 free (options); free (non_options); 107 108 } 108 ++ _optind;109 ++optind; 109 110 done = 1; 110 111 return -1; … … 113 114 { 114 115 PUT (options); 115 sw_char = argv[ _optind][0];116 next_opt = argv[ _optind]+1;116 sw_char = argv[optind][0]; 117 next_opt = argv[optind]+1; 117 118 } 118 119 } 119 120 c = *next_opt++; 120 121 if (*next_opt == 0) /* Move to next argument if end of argument reached */ 121 ++ _optind;122 ++optind; 122 123 if (c == ':' || (q = strchr (opt_str, c)) == NULL) 123 124 { 124 if ( _opterr && opt_str[0] != ':')125 if (opterr && opt_str[0] != ':') 125 126 { 126 127 if (c < ' ' || c >= 127) … … 131 132 argv[0], sw_char, c); 132 133 } 133 _optopt = c;134 optopt = c; 134 135 return '?'; 135 136 } … … 138 139 if (*next_opt != 0) /* Argument given */ 139 140 { 140 _optarg = next_opt;141 optarg = next_opt; 141 142 next_opt = ""; 142 ++ _optind;143 ++optind; 143 144 } 144 145 else if (q[2] == ':') 145 _optarg = NULL;/* Optional argument missing */146 else if ( _optind >= argc)146 optarg = NULL; /* Optional argument missing */ 147 else if (optind >= argc) 147 148 { /* Required argument missing */ 148 if ( _opterr && opt_str[0] != ':')149 if (opterr && opt_str[0] != ':') 149 150 fprintf (stderr, "%s: no argument for `%c%c' option\n", 150 151 argv[0], sw_char, c); 151 _optopt = c;152 optopt = c; 152 153 return (opt_str[0] == ':' ? ':' : '?'); 153 154 } … … 155 156 { 156 157 PUT (options); 157 _optarg = argv[_optind++];158 optarg = argv[optind++]; 158 159 } 159 160 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getpass1.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* getpass1.c (emx+gcc) -- Copyright (c) 1994-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <unistd.h> 4 5 #include <sys/ioctl.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getpass2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 2 2 /* Copyright (c) 1994-1995 by Eberhard Mattes */ 3 3 4 #include "libc-alias.h" 4 5 #include <stdio.h> 5 6 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/getvol.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* getvol.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> … … 11 12 char *_getvol (char drive) 12 13 { 13 #if defined (__MT__)14 14 struct _thread *tp = _thread(); 15 #define result (tp->_th_vollabel)16 #else17 static char result[12];18 #endif19 15 20 16 if (drive == 0) … … 33 29 if (rc != 0) 34 30 return NULL; 35 strcpy ( result, fsinfo.vol.szVolLabel);31 strcpy (tp->_th_vollabel, fsinfo.vol.szVolLabel); 36 32 37 return result;33 return tp->_th_vollabel; 38 34 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/glob.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* glob.c (emx+gcc) -- Copyright (c) 1995-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/makepath.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* makepath.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <sys/nls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/os2bad.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* os2bad.c (emx+gcc) */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/path.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* path.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/rand.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 5 5 #include <emx/thread.h> 6 6 7 #if defined (__MT__)8 #define _rand (tp->_th_rand)9 #else10 static unsigned int _rand = 1;11 #endif12 13 14 7 int _STD(rand) (void) 15 8 { 16 #if defined (__MT__)17 9 struct _thread *tp = _thread(); 18 #endif 19 20 _rand = _rand * 69069 + 5; 21 return (_rand >> 16) & 0x7fff; 10 tp->_th_rand = tp->_th_rand * 69069 + 5; 11 return (tp->_th_rand >> 16) & 0x7fff; 22 12 } 23 24 13 25 14 void _STD(srand) (unsigned int seed) 26 15 { 27 #if defined (__MT__)28 16 struct _thread *tp = _thread(); 29 #endif 30 31 _rand = seed; 17 tp->_th_rand = seed; 32 18 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/readkbd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* readkbd.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/remext.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* remext.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/response.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* response.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/searchen.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* searchen.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/splitarg.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* splitarg.c (emx+gcc) -- Copyright (c) 1993-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/splitpat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* splitpath.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/swchar.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* swchar.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/wildcard.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* wildcard.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdio.h> 4 5 #include <stdlib.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/omflib/omflib0.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 6 6 #define TRUE 1 7 7 8 #ifndef _BYTE_WORD_DWORD 9 #define _BYTE_WORD_DWORD 8 10 typedef unsigned char byte; 9 11 typedef unsigned short word; 10 12 typedef unsigned long dword; 11 13 #endif /* _BYTE_WORD_DWORD */ 12 14 13 15 #define FLAG_DELETED 0x0001 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/386/_errno.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 #if defined (__MT__) 5 .globl __errno 6 .globl __errno_fun 6 7 7 .globl __errno 8 .globl __errno_fun 8 .text 9 9 10 .text 11 12 ALIGN 10 ALIGN 13 11 14 12 __errno: 15 13 __errno_fun: 16 fs 17 movl 12, %eax /* ptib2 */ 18 movl 0(%eax), %eax /* TID */ 19 movl __thread_tab(,%eax,4), %eax 20 / addl $0, %eax /* address of errno */ 21 EPILOGUE(_errno) 22 23 #else 24 25 .globl __errno 26 27 .text 28 29 ALIGN 30 31 __errno: 32 movl $_errno, %eax 33 EPILOGUE(_errno) 34 35 #endif 14 fs 15 movl 12, %eax /* ptib2 */ 16 movl 0(%eax), %eax /* TID */ 17 movl __thread_tab(,%eax,4), %eax 18 / addl $0, %eax /* address of errno */ 19 EPILOGUE(_errno) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/386/thread.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 / thread.s (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes 2 3 #if defined (__MT__)4 2 5 3 #include <emx/asm386.h> 6 4 7 5 .globl __thread 8 6 9 7 .text 10 8 11 9 ALIGN 12 10 13 11 __thread: 14 fs 15 movl 12, %eax /* ptib2 */ 16 movl 0(%eax), %edx /* TID */ 17 movl __thread_tab(,%edx,4), %eax 18 testl %eax, %eax 19 jz 1f 12 fs 13 movl 12, %eax /* ptib2 */ 14 movl 0(%eax), %edx /* TID */ 15 movl __thread_tab(,%edx,4), %eax 16 testl %eax, %eax 17 jnz Lreturn 18 19 pushl %edx 20 call ___alloc_thread 21 popl %edx 22 testl %eax, %eax 23 jz Lreturn 24 movl %eax, __thread_tab(,%edx,4) 25 20 26 Lreturn:EPILOGUE(_thread) 21 22 ALIGN23 1: pushl %edx24 call ___alloc_thread25 popl %edx26 testl %eax, %eax27 jz Lreturn28 movl %eax, __thread_tab(,%edx,4)29 jmp Lreturn30 31 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/beginthr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* beginth.c (emx+gcc) -- Copyright (c) 1992-1998 by Eberhard Mattes */ 2 2 3 #if defined (__MT__) 4 3 #include "libc-alias.h" 5 4 #include <stdlib.h> 6 5 #include <string.h> … … 131 130 DosExit ((tid == 1 ? EXIT_PROCESS : EXIT_THREAD), 0); 132 131 } 133 134 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/fmutex.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* fmutex.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSSEMAPHORES 4 5 #define INCL_DOSPROCESS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/fmutex2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* fmutex2.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <sys/builtin.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/fork.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 12 12 13 13 pid = __fork (); 14 #if defined (__MT__)15 14 if (pid == 0) 16 15 _rmutex_fork (); 17 #endif18 16 return pid; 19 17 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/rmutex.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* rmutex.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSERRORS 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/smutex.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* smutex.c (emx+gcc) */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSPROCESS 4 5 #include <os2.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/process/threadst.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* threadst.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #if defined (__MT__) 4 3 #include "libc-alias.h" 5 4 #include <stdlib.h> 6 5 #include <emx/thread.h> … … 10 9 return &_thread()->_th_store; 11 10 } 12 13 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/socket/inetntoa.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 8 8 char *inet_ntoa (struct in_addr in) 9 9 { 10 #if defined (__MT__)11 10 struct _thread *tp = _thread (); 12 #define result (tp->_th_inetntoa)13 #else14 static char result[16];15 #endif16 11 unsigned char *t; 17 12 18 13 t = (unsigned char *)∈ 19 sprintf ( result, "%d.%d.%d.%d",14 sprintf (tp->_th_inetntoa, "%d.%d.%d.%d", 20 15 t[0] & 0xff, t[1] & 0xff, t[2] & 0xff, t[3] & 0xff); 21 return result;16 return tp->_th_inetntoa; 22 17 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/386/crt0.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 / crt0.s (emx+gcc) -- Copyright (c) 1990-1998 by Eberhard Mattes 1 /* 2 Application entry point. 3 4 Copyright (c) 1992-1998 by Eberhard Mattes 5 Copyright (c) 2003 InnoTek Systemberatung GmbH 6 7 This is the routine that gets control first. 8 It should prepare argc/argv/envp and call the 9 main function. 10 */ 11 12 #include <emx/asm386.h> 2 13 3 14 .globl __text … … 7 18 8 19 __text: 9 push $__data 10 call __emx_init 20 call ___init_app 11 21 cld 12 call __entry1 13 call __entry2 22 leal (%esp), %edi /* argv[] */ 23 movl %edi, _STD(environ) 24 movl %edi, __org_environ 25 pushl %edi /* envp */ 26 call L_ptr_tbl 27 pushl %edi /* argv */ 28 call L_ptr_tbl 29 pushl %ecx /* argc */ 14 30 #if defined (MCRT0) 15 31 pushl $__mcleanup 16 32 call _atexit 17 addl $4, %esp18 33 pushl $__etext 19 34 pushl $__text 20 35 call _monstartup 21 addl $ 2*4, %esp36 addl $3*4, %esp 22 37 #endif 23 call __ startup38 call __CRT_init 24 39 call _main 25 40 addl $3*4, %esp 26 41 pushl %eax 27 42 call _exit 28 2: jmp 2b 43 1: jmp 1b /* Just in case exit() returns :-) */ 44 45 L_ptr_tbl: 46 xorl %eax, %eax 47 movl $-1, %ecx 48 2: incl %ecx 49 scasl 50 jne 2b 51 ret 29 52 30 53 .data … … 34 57 .long __os2dll // list of OS/2 DLL references 35 58 36 59 .stabs "__os2dll", 21, 0, 0, 0xffffffff 37 60 .stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff 38 61 .stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/386/dll0.s
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 / dll0.s (emx+gcc) -- Copyright (c) 1992-1998 by Eberhard Mattes 1 /* 2 Standard entry point for dynamic libraries. 3 4 Copyright (c) 1992-1998 by Eberhard Mattes 5 Copyright (c) 2003 InnoTek Systemberatung GmbH 6 7 This routine gets control right after dynamic library 8 is loaded. 9 */ 10 11 #include <emx/asm386.h> 2 12 3 13 .globl __text … … 7 17 8 18 __text: 9 push $__data 10 call __emx_init 11 cld 12 pushl %ebp 13 movl %esp, %ebp 14 pushl 12(%ebp) 15 pushl 8(%ebp) 16 call __DLL_InitTerm 17 addl $8, %esp 18 popl %ebp 19 ret 19 call ___init_dll 20 cld 21 pushl %ebp 22 movl %esp, %ebp 23 pushl 12(%ebp) 24 pushl 8(%ebp) 25 call __DLL_InitTerm 26 addl $8, %esp 27 popl %ebp 28 ret 20 29 21 30 .data 22 31 23 32 __data: 24 33 .long 0xba0bab // Magic number (error detection) 25 34 .long __os2dll // list of OS/2 DLL references 26 35 27 28 29 30 31 32 36 .stabs "__os2dll", 21, 0, 0, 0xffffffff 37 .stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff 38 .stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff 39 .stabs "___crtinit1__", 21, 0, 0, 0xffffffff 40 .stabs "___crtexit1__", 21, 0, 0, 0xffffffff 41 .stabs "___eh_frame__", 21, 0, 0, 0xffffffff -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/cleanup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 6 6 extern void __ctordtorTerm1 (int *ptr); 7 7 8 void _ cleanup(void)8 void _CRT_term (void) 9 9 { 10 10 __ctordtorTerm1 (&__crtexit1__); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/dllinit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* static/dllinit.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */ 2 2 3 int _CRT_init (void); 3 #include <emx/startup.h> 4 4 5 void __ctordtorInit (void); 5 6 void __ctordtorTerm (void); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/exit.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 14 14 for (i = _atexit_n-1; i >= 0; --i) 15 15 _atexit_v[i](); 16 _ cleanup();16 _CRT_term (); 17 17 _exit (ret); 18 18 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/gmon.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 140 140 return; 141 141 } 142 # ifdef DEBUG142 # ifdef GMON_DEBUG 143 143 fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz ); 144 # endif /* DEBUG */144 # endif /* GMON_DEBUG */ 145 145 write( fd , sbuf , ssiz ); 146 146 endfrom = s_textsize / (HASHFRACTION * sizeof(*froms)); … … 151 151 frompc = s_lowpc + (fromindex * HASHFRACTION * sizeof(*froms)); 152 152 for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) { 153 # ifdef DEBUG153 # ifdef GMON_DEBUG 154 154 fprintf( stderr , 155 155 "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" , 156 156 frompc , tos[toindex].selfpc , tos[toindex].count ); 157 # endif /* DEBUG */157 # endif /* GMON_DEBUG */ 158 158 rawarc.raw_frompc = (unsigned long) frompc; 159 159 rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/startup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 18 18 extern void __ctordtorInit1 (int *ptr); 19 19 20 /* The version of this libc. */21 static const char _libc_version[] =22 " libc for emx 0.9d";23 24 /* Display this warning if emx.dll or emx.exe is out of date. */25 static const char _version_warning[] =26 "WARNING: emx 0.9d or later required\r\n";27 28 29 20 static void init_files (void); 30 31 21 32 22 /* Initialize the C run-time library. This function is called from 33 23 crt0.s. */ 34 35 void _startup (void) 24 int _CRT_init (void) 36 25 { 37 26 static int startup_flag; … … 39 28 /* Protect against multiple calls (for instance, by _CRT_init() in a 40 29 _DLL_InitTerm() and by the application program's startup code). */ 41 42 30 if (startup_flag) 43 return ;31 return 0; 44 32 startup_flag = 1; 45 33 46 /* Print a warning message on handle 2 (stderr) if emx.dll or47 emx.exe is out of date. */48 49 if (_emx_vcmp < 0x302e3964) /* 0.9d */50 __write (2, _version_warning, sizeof (_version_warning) - 1);51 52 34 /* Initialize the file handles. */ 53 54 35 init_files (); 55 36 56 37 /* Initialize streams etc. if required. */ 57 58 38 __ctordtorInit1 (&__crtinit1__); 59 39 … … 63 43 The above code usually sets errno to EBADF, therefore we reset 64 44 errno to zero before calling main(). */ 45 errno = 0; 65 46 66 errno =0;47 return 0; 67 48 } 68 49 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/startup/startup.smak
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r235 r236 1 libc.TSRC.386 += src/lib/startup/386/crt1.s 2 libc.TSRC += $(addprefix src/lib/startup/, crtinit.c crtterm.c cleanup.c \ 3 ctor1.c dtor1.c exit.c startup.c _exit.c dllinit.c) 1 libc.TSRC += $(filter-out %gmon.c,$(wildcard src/lib/startup/*.c)) 4 2 5 3 # Build startup object files separately (not included in libraries) … … 19 17 libc: $(.DIRS) $(.OBJS) 20 18 21 DO.INSTALL += $(call CP,$(.OBJS) $(INS)lib/)$(NL) 19 INS.FILES += $(addprefix $(INS)lib/,$(notdir $(.OBJS))) 20 $(addprefix $(INS)lib/,$(notdir $(.OBJS))): $(.OBJS) 21 $(call CP,$^,$(dir $@)) 22 22 23 23 $.aout/src/lib/startup/mcrt0.o: src/lib/startup/386/crt0.s -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/static/dllinit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* static/dllinit.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */ 2 2 3 int _CRT_init (void); 3 #include <emx/startup.h> 4 4 5 void __ctordtorInit (void); 5 6 void __ctordtorTerm (void); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/bcmp.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ _bcmp5 .globl _STD(bcmp) 6 6 7 7 / int _bcmp (const void *s1, const void *s2, size_t n) … … 21 21 ALIGN 22 22 23 _ _bcmp:23 _STD(bcmp): 24 24 PROFILE_NOFRAME 25 25 pushl %esi … … 36 36 1: popl %edi 37 37 popl %esi 38 EPILOGUE(_ bcmp)38 EPILOGUE(_STD(bcmp)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/bcopy.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ _bcopy5 .globl _STD(bcopy) 6 6 7 7 / void _bcopy (const void *s1, void *s2, size_t n) … … 23 23 ALIGN 24 24 25 _ _bcopy:25 _STD(bcopy): 26 26 PROFILE_NOFRAME 27 27 pushl %esi … … 60 60 Lreturn:popl %edi 61 61 popl %esi 62 EPILOGUE(_ bcopy)62 EPILOGUE(_STD(bcopy)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/bzero.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ _bzero5 .globl _STD(bzero) 6 6 7 7 / void _bzero (void *s, size_t n) … … 19 19 ALIGN 20 20 21 _ _bzero:21 _STD(bzero): 22 22 PROFILE_NOFRAME 23 23 pushl %edi … … 33 33 stosb 34 34 popl %edi 35 EPILOGUE(_ bzero)35 EPILOGUE(_STD(bzero)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/ffs.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ _ffs5 .globl _STD(ffs) 6 6 7 7 / int _ffs (int i) … … 20 20 ALIGN 21 21 22 _ _ffs:22 _STD(ffs): 23 23 PROFILE_NOFRAME 24 24 movl 1*4(%esp), %edx /* i */ … … 30 30 Lzero: xorl %eax, %eax 31 31 ALIGN 32 Lreturn:EPILOGUE(_ ffs)32 Lreturn:EPILOGUE(_STD(ffs)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/index.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ _index5 .globl _STD(index) 6 6 7 7 / char *_index (const char *string, int c) … … 19 19 ALIGN 20 20 21 _ _index:21 _STD(index): 22 22 PROFILE_NOFRAME 23 23 pushl %esi … … 48 48 3: lea -1(%esi), %eax 49 49 Ldone: popl %esi 50 EPILOGUE(_ index)50 EPILOGUE(_STD(index)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/memchr.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 40 40 ALIGN 41 41 Ldone: popl %edi 42 EPILOGUE( memchr)42 EPILOGUE(_STD(memchr)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/memcmp.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 41 41 Ldone: popl %edi 42 42 popl %esi 43 EPILOGUE( memcmp)43 EPILOGUE(_STD(memcmp)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/memcpy.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 37 37 popl %edi 38 38 popl %esi 39 EPILOGUE( memcpy)39 EPILOGUE(_STD(memcpy)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/memmove.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 63 63 popl %edi 64 64 popl %esi 65 EPILOGUE( memmove)65 EPILOGUE(_STD(memmove)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/memset.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 39 39 movl 2*4(%esp), %eax /* s */ 40 40 popl %edi 41 EPILOGUE( memset)41 EPILOGUE(_STD(memset)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/rindex.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ _rindex5 .globl _STD(rindex) 6 6 7 7 / char *_rindex (const char *string, int c) … … 23 23 ALIGN 24 24 25 _ _rindex:25 _STD(rindex): 26 26 PROFILE_NOFRAME 27 27 pushl %edi … … 45 45 Lnull: xorl %eax, %eax 46 46 Lreturn:popl %edi 47 EPILOGUE(_ rindex)47 EPILOGUE(_STD(rindex)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/strcat.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 42 42 popl %edi 43 43 popl %esi 44 EPILOGUE( strcat)44 EPILOGUE(_STD(strcat)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/strchr.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 48 48 Lfound: lea -1(%esi), %eax 49 49 Lreturn:popl %esi 50 EPILOGUE( strchr)50 EPILOGUE(_STD(strchr)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/strcmp.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 44 44 Lreturn:popl %edi 45 45 popl %esi 46 EPILOGUE( strcmp)46 EPILOGUE(_STD(strcmp)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/strcpy.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 35 35 popl %edi 36 36 popl %esi 37 EPILOGUE( strcpy)37 EPILOGUE(_STD(strcpy)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/strlen.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 31 31 subl %ecx, %eax 32 32 popl %edi 33 EPILOGUE( strlen)33 EPILOGUE(_STD(strlen)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/strrchr.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 45 45 Lnull: xorl %eax, %eax 46 46 Lreturn:popl %edi 47 EPILOGUE( strrchr)47 EPILOGUE(_STD(strrchr)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/386/swab.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 3 3 #include <emx/asm386.h> 4 4 5 .globl _ _swab5 .globl _STD(swab) 6 6 7 7 / void _swab (const void *src, void *dst, size_t n) … … 24 24 ALIGN 25 25 26 _ _swab:26 _STD(swab): 27 27 PROFILE_NOFRAME 28 28 pushl %esi … … 41 41 Lreturn:popl %edi 42 42 popl %esi 43 EPILOGUE(_ swab)43 EPILOGUE(_STD(swab)) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strerror.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 13 13 { 14 14 static char msg[] = "Unknown error "; 15 #if defined (__MT__)16 15 struct _thread *tp = _thread(); 17 #define result (tp->_th_error) 18 #else 19 static char result[32]; 20 #endif 21 memcpy (result, msg, sizeof (msg) - 1); 22 _itoa (errnum, result + sizeof (msg) - 1, 10); 23 return result; 16 memcpy (tp->_th_error, msg, sizeof (msg) - 1); 17 _itoa (errnum, tp->_th_error + sizeof (msg) - 1, 10); 18 return tp->_th_error; 24 19 } 25 20 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/str/strtok.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 9 9 char table[256]; 10 10 unsigned char *p, *result; 11 #if defined (__MT__)12 11 struct _thread *tp = _thread (); 13 #define next (tp->_th_strtok_ptr)14 #else15 static unsigned char *next = NULL;16 #endif17 12 if (string1 != NULL) 18 13 p = (unsigned char *)string1; 19 14 else 20 15 { 21 if ( next== NULL)16 if (tp->_th_strtok_ptr == NULL) 22 17 return NULL; 23 p = next;18 p = tp->_th_strtok_ptr; 24 19 } 25 20 memset (table, 0, 256); … … 37 32 if (p == result) 38 33 { 39 next= NULL;34 tp->_th_strtok_ptr = NULL; 40 35 return NULL; 41 36 } … … 43 38 else 44 39 *p++ = 0; 45 next= p;40 tp->_th_strtok_ptr = p; 46 41 return (char *)result; 47 42 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/386/systhrea.s
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 / systhrea.s (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes 2 3 #if defined (__MT__)4 2 5 3 .globl __sys_thread … … 27 25 movl __sys_thread_table(,%edx,4), %eax 28 26 ret 29 30 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/386/thunk0.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 / thunk0.asm (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes 2 2 3 .globl __ emx_16to324 .globl __ emx_32to163 .globl __libc_16to32 4 .globl __libc_32to16 5 5 6 6 .p2align 2 7 __ emx_32to16: movl 4(%esp),%eax7 __libc_32to16: movl 4(%esp),%eax 8 8 jmp DosFlatToSel 9 9 10 10 .p2align 2 11 __ emx_16to32: movl 4(%esp),%eax11 __libc_16to32: movl 4(%esp),%eax 12 12 jmp DosSelToFlat -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/386/thunk1.s
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 / thunk1.asm (emx+gcc) -- Copyright (c) 1992-1994 by Eberhard Mattes 2 2 3 .globl __ emx_thunk13 .globl __libc_thunk1 4 4 5 5 / 6 / unsigned long _ emx_thunk1 (void *args, void *fun)6 / unsigned long _libc_thunk1 (void *args, void *fun) 7 7 / 8 8 / Call 16-bit code … … 26 26 .set RETADDR, -4*4 # Offset to spare space relative to FUN 27 27 28 __ emx_thunk1: pushl %ebp # Leave two dwords spare28 __libc_thunk1: pushl %ebp # Leave two dwords spare 29 29 pushl %ebp # space for 32-bit return address 30 30 pushl %ebp # Set up stack frame … … 34 34 pushl %ebx # Save %ebx 35 35 pushl %es # (2) Save %es 36 / movw %ss, %dx # Prepare conversion of37 / andb $3, %dl # %esp to %ss:%sp38 / orb $4, %dl # LDT39 36 movl %esp, %eax # Check stack 40 37 cmpw $0x1000, %ax # 1000H bytes left in this 64K … … 101 98 .byte 0x67,0x66,0xff,0x6e,RETADDR 102 99 103 / movl %esp, %eax104 / roll $16, %eax105 / shlw $3, %ax106 / orb %dl, %al107 / pushl %eax # Push new %ss108 / shrl $16, %eax109 / pushl %eax # Push new %esp110 / lss (%esp), %esp # Switch to new %ss:%sp111 / jmpl FAR PTR TEXT16:THUNK16_CALL ; (3)112 113 100 .p2align 2 114 101 Lthunk1_ret: movzwl %di, %esp # (4) Remove arguments -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__chdir.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/chdir.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__chmod.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/chmod.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__chsize.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/chsize.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__close.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/close.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__dup.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/dup.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__dup2.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/dup2.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__endthread.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/endthrea.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #if defined (__MT__) 4 3 #include "libc-alias.h" 5 4 #define INCL_DOS 6 5 #include <os2emx.h> … … 22 21 return 0; 23 22 } 24 25 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__exit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/exit.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__fcntl.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/fcntl.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <fcntl.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__fork.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 #include "libc-alias.h" 1 2 #include <stdlib.h> 2 3 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__fstat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/fstat.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ftime.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* sys/ftime.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <sys/timeb.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ftruncate.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/ftruncat.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__getcwd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/getcwd.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__getdrive.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* sys/getdrive.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__imphandle.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* imphandl.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/syscalls.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__init.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 /* sys/init.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 1 /* 2 Application low-level initialization routine. 3 4 Copyright (c) 1992-1998 by Eberhard Mattes 5 Copyright (c) 2003 InnoTek Systemberatung GmbH 6 7 This routine is called from crt0.o. It should parse 8 argv and envp, initialize heap and do all other sorts 9 of low-level initialization. 10 */ 11 12 #include "libc-alias.h" 3 13 #define INCL_DOS 4 14 #include <os2emx.h> … … 10 20 #include <alloca.h> 11 21 12 #define SYS_PRIVATE_HEAP_SIZE 0x10000013 14 22 #define EXTERN 15 23 #define INIT(x) = x … … 23 31 static char *pool; 24 32 33 extern void __init_os_version (void); 34 extern void __init_dll (); 25 35 extern void volatile __init_ret (void *stack); 26 36 static void parse_args (const char *src); … … 113 123 114 124 115 struct layout 116 { 117 ULONG text_base; 118 ULONG text_end; 119 ULONG data_base; 120 ULONG data_end; 121 ULONG bss_base; 122 ULONG bss_end; 123 ULONG heap_base; 124 ULONG heap_end; 125 ULONG heap_brk; 126 ULONG heap_off; 127 ULONG os2_dll; 128 ULONG stack_base; 129 ULONG stack_end; 130 ULONG flags; 131 ULONG reserved[2]; 132 UCHAR options[64]; 133 }; 134 135 136 void __init (struct layout *layout) 125 void __init (int is_dll) 137 126 { 138 127 ULONG rc; … … 142 131 int n; 143 132 ULONG times; 144 static char init_level; 145 146 /* In a custom C runtime DLL, this function is called at least 147 twice, once from the startup code of this DLL, once from the 148 startup code of the application, and once from each DLL using 149 this DLL. init_level indicates which initializations have been 150 performed. Initially init_level is 0, meaning no initializations 151 have been done. init_level 1 indicates that initializations 152 common to DLLs and applications have been performed. init_level 153 2 indicates that initializations specific to applications have 154 been done as well as initializations of init_level 1. */ 155 156 if (init_level == 0) 157 { 158 init_level = 1; 159 160 /* Initialize the heap. Here, we only create the semaphore 161 (while having only one thread). The heap will be created by 162 __sbrk(). */ 163 164 #if defined (__MT__) 165 if (_fmutex_create (&_sys_heap_fmutex, 0) != 0) 166 DosExit (EXIT_PROCESS, 255); 167 #endif 168 169 /* Get the process ID and parent process ID. This is also 170 required for (stand-alone) DLLs. At least, we need ptib and 171 ppib. */ 172 173 rc = DosGetInfoBlocks (&ptib, &ppib); 174 if (rc != 0) 175 DosExit (EXIT_PROCESS, 255); 176 _sys_pid = ppib->pib_ulpid; 177 _sys_ppid = ppib->pib_ulppid; 178 179 /* Initialize threads. This is also required for (stand-alone) 180 DLLs as these may call _beginthread(). */ 181 #if defined (__MT__) 182 rc = DosAllocMem (&_sys_private_heap, SYS_PRIVATE_HEAP_SIZE, 183 PAG_READ | PAG_WRITE); 184 if (rc != 0) 185 DosExit (EXIT_PROCESS, 255); 186 rc = DosSubSetMem (_sys_private_heap, 187 DOSSUB_INIT | DOSSUB_SPARSE_OBJ | DOSSUB_SERIALIZE, 188 SYS_PRIVATE_HEAP_SIZE); 189 if (rc != 0) 190 DosExit (EXIT_PROCESS, 255); 191 for (n = 0; n < MAX_THREADS; ++n) 192 _sys_thread_table[n] = NULL; 193 __newthread (ptib->tib_ptib2->tib2_ultid); 194 #else 195 _sys_init_thread (&_sys_thread_one); 196 #endif 197 198 /* Get current time for clock(). We do this also for 199 (stand-alone) DLLs. */ 200 201 _sys_get_clock (&_sys_clock0_ms); 202 } 203 204 /* Stop here if called from the startup code of a DLL. The 205 remaining code is used only if this function has been called from 206 the startup code of an application. */ 207 208 if (layout->flags & 1) 133 static int initialized = 0; 134 135 if (initialized) 209 136 return; 210 211 /* Avoid performing the following initializations more than once. */ 212 213 if (init_level == 2) 214 return; 215 init_level = 2; 137 initialized = 1; 138 139 /* Do the initialization common for executables and DLLs. */ 140 __init_dll (); 216 141 217 142 /* Get ptib and ppib again, in case __init() has already been called 218 143 for a DLL. */ 219 220 144 rc = DosGetInfoBlocks (&ptib, &ppib); 221 145 if (rc != 0) … … 223 147 224 148 /* Copy command line arguments and environment. */ 225 226 149 vec = NULL; pool = NULL; 227 150 parse_env (ppib->pib_pchenv); … … 240 163 241 164 /* Initialize exception handling. */ 242 243 165 _sys_xreg->prev_structure = (void *)0xffffffff; 244 166 _sys_xreg->ExceptionHandler = _sys_exception; … … 250 172 251 173 /* Return to the program. */ 252 253 174 __init_ret (stack); 254 175 } … … 338 259 _sys_deliver_pending_signals (tp); 339 260 switch (sig_info[signo].fun_action) 340 261 { 341 262 case ST_TERM: 342 263 _sys_terminate (signo); … … 345 266 case ST_IGNORE: 346 267 return XCPT_CONTINUE_EXECUTION; 347 268 } 348 269 return XCPT_CONTINUE_SEARCH; /* Keep the optimizer happy */ 349 270 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__initthread.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/initthre.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #if defined (__MT__) 4 3 #include "libc-alias.h" 5 4 #include <errno.h> 6 5 #define INCL_DOS … … 16 15 return 0; 17 16 } 18 19 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ioctl1.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/ioctl1.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <errno.h> 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ioctl2.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* sys/ioctl2.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <sys/ioctl.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__lseek.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/lseek.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__mkdir.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* sys/mkdir.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__newthread.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/newthrea.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #if defined (__MT__) 4 3 #include "libc-alias.h" 5 4 #include <errno.h> 6 5 #define INCL_DOS … … 38 37 return __sys_newthread (tid, &errno); 39 38 } 40 41 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__nls_ctype.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/nls_ctyp.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSNLS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__nls_memupr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/nls_memu.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSNLS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__open.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/open.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSERRORS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__os_version.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/os_ver.c (emx+gcc) -- Copyright (c) 1992-1995 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSMISC 4 5 #include <os2emx.h> 5 6 6 int __os_version (void) 7 unsigned char _osmajor; 8 unsigned char _osminor; 9 10 void __init_os_version (void) 7 11 { 8 LONG maj, min; 9 10 maj = 0; min = 0; /* In case DosQuerySysInfo fails... */ 11 DosQuerySysInfo (QSV_VERSION_MAJOR, QSV_VERSION_MAJOR, &maj, sizeof (maj)); 12 DosQuerySysInfo (QSV_VERSION_MINOR, QSV_VERSION_MINOR, &min, sizeof (min)); 13 return ((min & 0xff) << 8) | (maj & 0xff) | 0x6d650000; 12 _osmajor = _osminor = 0; /* In case DosQuerySysInfo fails... */ 13 DosQuerySysInfo (QSV_VERSION_MAJOR, QSV_VERSION_MAJOR, &_osmajor, sizeof (_osmajor)); 14 DosQuerySysInfo (QSV_VERSION_MINOR, QSV_VERSION_MINOR, &_osminor, sizeof (_osminor)); 14 15 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__pipe.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/pipe.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSQUEUES 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__read.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/read.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__read_kbd.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/read_kbd.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSFILEMGR 4 5 #define INCL_KBD -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__rmdir.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* sys/rmdir.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__select.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 #include "libc-alias.h" 1 2 #include <stdlib.h> 2 3 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__settime.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 #include "libc-alias.h" 1 2 #include <time.h> 2 3 #include <sys/time.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__spawnve.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* sys/spawnve.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__stat.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/stat.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__swchar.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/swchar.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <emx/syscalls.h> 4 5 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ttyname.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 #include "libc-alias.h" 1 2 #include <stdlib.h> 2 3 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ulimit.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/ulimit.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <sys/ulimit.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__utimes.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/utimes.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <string.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__wait.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/wait.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSPROCESS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__waitpid.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/waitpid.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSPROCESS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__write.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/write.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/brk.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 13 13 ULONG base; 14 14 15 #ifdef __MT__16 15 if (_fmutex_request (&_sys_heap_fmutex, _FMR_IGNINT) != 0) 17 16 return (void *)-1; 18 #endif19 17 20 18 if (_sys_heap_obj_count == 0) … … 29 27 base = _sys_shrink_heap_to ((ULONG)brkp); 30 28 31 #ifdef __MT__32 29 if (_fmutex_release (&_sys_heap_fmutex) != 0) 33 30 return (void *)-1; 34 #endif35 31 36 32 if (base == 0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/core.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* core.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <stdlib.h> 4 5 #include <emx/syscalls.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/execname.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* sys/execname.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filefind.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/filefind.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filesys.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* sys/filesys.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <string.h> 4 5 #include <errno.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/heap.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/heap.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSERRORS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/heapdump.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/heapdump.c (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include "syscalls.h" 4 5 #include <stdio.h> 5 6 6 7 7 void _sys_dump_heap_objs (FILE *f) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/p2t.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 1 1 /* sys/p2t.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <os2emx.h> 4 5 #include <time.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sbrk.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 14 14 ULONG base; 15 15 16 #ifdef __MT__17 16 if (_fmutex_request (&_sys_heap_fmutex, _FMR_IGNINT) != 0) 18 17 return (void *)-1; 19 #endif20 18 21 19 if (incr >= 0) … … 24 22 base = _sys_shrink_heap_by (-incr, _sys_uflags & _UF_SBRK_MODEL); 25 23 26 #ifdef __MT__27 24 if (_fmutex_release (&_sys_heap_fmutex) != 0) 28 25 return (void *)-1; 29 #endif30 26 31 27 if (base == 0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/scrsize.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* sys/scrsize.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_VIO 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/seterrno.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 1 1 /* sys/seterrno.c (emx+gcc) -- Copyright (c) 1992-1998 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <errno.h> 4 5 #include "syscalls.h" -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sleep2.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* sys/sleep2.c (emx+gcc) -- Copyright (c) 1993-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #define INCL_DOSPROCESS 4 5 #include <os2emx.h> -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/syscalls.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 1 1 /* sys/syscalls.h (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */ 2 2 3 #include "libc-alias.h" 3 4 #include <sys/signal.h> 4 5 … … 121 122 void _sys_deliver_pending_signals (thread_data *tp); 122 123 123 #if defined (__MT__)124 125 124 #define MAX_THREADS 1024 126 125 … … 135 134 #define SYS_THREAD (_sys_thread ()) 136 135 137 #else /* !defined (_MT) */138 139 EXTERN thread_data _sys_thread_one;140 #define SYS_THREAD (&_sys_thread_one)141 142 #endif /* !defined (_MT) */143 144 136 #endif /* _OS2EMX_H */ 145 137 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/uflags.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 4 4 #include "syscalls.h" 5 5 6 int _ STD(uflags)(int mask, int new_flags)6 int _uflags (int mask, int new_flags) 7 7 { 8 8 int ret; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/asctime.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 13 13 char *_STD(asctime) (const struct tm *t) 14 14 { 15 #if defined (__MT__)16 15 struct _thread *tp = _thread(); 17 16 #define result (tp->_th_asctime_buf) 18 #else19 static char result[26];20 #endif21 17 22 18 memcpy (result+0, wdays+t->tm_wday*3, 3); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/ftime.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 11 11 time_t t_loc; 12 12 13 if (!_tzset_flag) _tzset ();13 if (!_tzset_flag) tzset (); 14 14 __ftime (ptr); 15 15 t_loc = ptr->time; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/gettimeo.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 14 14 int dst; 15 15 16 if (!_tzset_flag) _tzset ();16 if (!_tzset_flag) tzset (); 17 17 __ftime (&tb); 18 18 t_loc = tb.time; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/gmtime.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 9 9 struct tm *_STD(gmtime) (const time_t *t) 10 10 { 11 #if defined (__MT__)12 11 struct _thread *tp = _thread (); 13 #define result (tp->_th_gmtime_buf) 14 #else 15 static struct tm result; 16 #endif 17 return _gmtime (&result, t); 12 return _gmtime (&tp->_th_gmtime_buf, t); 18 13 } 19 14 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/localtim.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 8 8 struct tm *_STD(localtime) (const time_t *t) 9 9 { 10 #if defined (__MT__)11 10 struct _thread *tp = _thread (); 12 #define result (tp->_th_gmtime_buf) 13 #else 14 static struct tm result; 15 #endif 16 return _localtime (&result, t); 11 return _localtime (&tp->_th_gmtime_buf, t); 17 12 } 18 13 … … 23 18 struct tm *p; 24 19 25 if (!_tzset_flag) _tzset ();20 if (!_tzset_flag) tzset (); 26 21 lt = *t; 27 22 isdst = _gmt2loc (<); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/mktime.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 12 12 int dst; 13 13 14 if (!_tzset_flag) _tzset ();14 if (!_tzset_flag) tzset (); 15 15 16 16 /* _mktime() requires that tm_mon is in range. The other members -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/settimeo.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r235 r236 18 18 return -1; 19 19 } 20 if (!_tzset_flag) _tzset ();20 if (!_tzset_flag) tzset (); 21 21 t = tp->tv_sec; 22 22 local.tv_sec = _gmt2loc (&t); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/time/strftime.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r235 r236 103 103 int mbn, shift; 104 104 105 if (!_tzset_flag) _tzset ();105 if (!_tzset_flag) tzset (); 106 106 shift = 0; n = 0; 107 107 while ((c = *format) != 0) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libomflib/omflib0.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r235 r236 6 6 #define TRUE 1 7 7 8 #ifndef _BYTE_WORD_DWORD 9 #define _BYTE_WORD_DWORD 8 10 typedef unsigned char byte; 9 11 typedef unsigned short word; 10 12 typedef unsigned long dword; 11 13 #endif /* _BYTE_WORD_DWORD */ 12 14 13 15 #define FLAG_DELETED 0x0001 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/regexp/regexp.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 775 775 STATIC int regrepeat(); 776 776 777 #ifdef DEBUG777 #ifdef REGEXP_DEBUG 778 778 int regnarrate = 0; 779 779 void regdump(); … … 892 892 893 893 scan = prog; 894 #ifdef DEBUG894 #ifdef REGEXP_DEBUG 895 895 if (scan != NULL && regnarrate) 896 896 fprintf(stderr, "%s(\n", regprop(scan)); 897 897 #endif 898 898 while (scan != NULL) { 899 #ifdef DEBUG899 #ifdef REGEXP_DEBUG 900 900 if (regnarrate) 901 901 fprintf(stderr, "%s...\n", regprop(scan)); … … 1151 1151 } 1152 1152 1153 #ifdef DEBUG1153 #ifdef REGEXP_DEBUG 1154 1154 1155 1155 STATIC char *regprop(); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/version.smak
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r235 r236 14 14 VERSION = $(VH).$(VM).$(VL) 15 15 16 # The flag for C compiler to pass the VERSION macro to preprocessor 17 CFLAGS.DEF.VERSION = -DVERSION=\\\"$(VERSION)\\\" 18 16 19 # Copyright 17 20 COPYRIGHT = Copyright (c) 2003 InnoTek Systemberatung GmbH -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.