From ec59b7731fe935130b6d02707faec7dabdaef583 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Sun, 31 Dec 2023 17:22:34 +0100 Subject: [PATCH] wlink separate Windows formats from OS/2 formats Now MK_OS2... macros doesn't include any MK_WIN... macros rename macro MK_WINDOWS to MK_WIN_NE remove macros which separate MK_WIN... macros from MK_OS2... macros now only following macros are defined for OS/2 formats MK_OS2_NE MK_OS2_LE MK_OS2_LX MK_OS2_FLAT MK_OS2 following Windows macros are defined as standalone and is not combined with other macros MK_WIN_NE MK_WIN_VXD --- bld/wl/c/autogrp.c | 4 +- bld/wl/c/cmdall.c | 48 +++++++++---------- bld/wl/c/cmdline.c | 14 +++--- bld/wl/c/cmdos2.c | 112 ++++++++++++++++++++++---------------------- bld/wl/c/loadelf.c | 2 +- bld/wl/c/loadfile.c | 10 ++-- bld/wl/c/loadflat.c | 2 +- bld/wl/c/loados2.c | 14 +++--- bld/wl/c/loadraw.c | 4 +- bld/wl/c/lsymtab.c | 2 +- bld/wl/c/mapio.c | 4 +- bld/wl/c/msg.c | 4 +- bld/wl/c/obj2supp.c | 34 +++++++------- bld/wl/c/objcalc.c | 12 ++--- bld/wl/c/objomf.c | 2 +- bld/wl/c/objpass1.c | 14 +++--- bld/wl/c/permdata.c | 16 +++---- bld/wl/c/reloc.c | 22 ++++----- bld/wl/c/toc.c | 5 +- bld/wl/c/wlink.c | 8 ++-- bld/wl/h/formats.h | 22 ++++----- 21 files changed, 176 insertions(+), 179 deletions(-) diff --git a/bld/wl/c/autogrp.c b/bld/wl/c/autogrp.c index d92edb4358..e36f2dfa67 100644 --- a/bld/wl/c/autogrp.c +++ b/bld/wl/c/autogrp.c @@ -71,8 +71,8 @@ static offset GetSegGroupPackLimit( seg_leader *seg ) } if( seg->info & USE_32 ) { limit = 0xFFFFFFFF; - } else if( FmtData.type & MK_WINDOWS ) { /* windows doesn't like */ - limit = 0xFFF0; /* large code segments */ + } else if( FmtData.type & MK_WIN_NE ) { /* windows doesn't like */ + limit = 0xFFF0; /* large code segments */ } else { limit = 0xFFFF; } diff --git a/bld/wl/c/cmdall.c b/bld/wl/c/cmdall.c index 432bf8d102..c4bdffd3ec 100644 --- a/bld/wl/c/cmdall.c +++ b/bld/wl/c/cmdall.c @@ -983,7 +983,7 @@ static char **getStubNamePtr( void ) /**********************************/ { #ifdef _OS2 - if( HintFormat( MK_OS2 | MK_PE | MK_WIN_VXD ) ) { + if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ) ) { return( &FmtData.u.os2fam.stub_file_name ); } #endif @@ -1383,7 +1383,7 @@ static bool ProcImport( void ) /****************************/ { #ifdef _OS2 - if( HintFormat( MK_OS2 | MK_PE ) ) { + if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE ) ) { return( ProcOS2Import() ); } #endif @@ -1404,7 +1404,7 @@ static bool ProcExport( void ) /****************************/ { #ifdef _OS2 - if( HintFormat( MK_OS2 | MK_PE | MK_WIN_VXD ) ) { + if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ) ) { return( ProcOS2Export() ); } #endif @@ -1455,7 +1455,7 @@ static bool ProcSegment( void ) /*****************************/ { #ifdef _OS2 - if( HintFormat( MK_OS2 | MK_PE | MK_WIN_VXD ) ) { + if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ) ) { return( ProcOS2Segment() ); } #endif @@ -1473,7 +1473,7 @@ static bool ProcAlignment( void ) /*******************************/ { #ifdef _OS2 - if( HintFormat( MK_OS2_16BIT | MK_OS2_LX | MK_PE ) ) { + if( HintFormat( MK_OS2_NE | MK_WIN_NE | MK_OS2_LX | MK_PE ) ) { return( ProcOS2Alignment() ); } #endif @@ -1496,7 +1496,7 @@ static bool ProcHeapSize( void ) } #endif #ifdef _OS2 - if( HintFormat( MK_OS2 | MK_PE ) ) { + if( HintFormat( MK_OS2 | MK_WIN_NE | MK_PE ) ) { return( ProcOS2HeapSize() ); } #endif @@ -1535,7 +1535,7 @@ static bool ProcOffset( void ) } #endif //#ifdef _OS2 -// if( FmtData.type & (MK_OS2 | MK_PE) ) { +// if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE) ) { // ChkBase( _64K ); // return( true ); // } @@ -1956,28 +1956,28 @@ static parse_entry MainOptions[] = { "INCremental", ProcIncremental, MK_ALL, 0, "FILLchar", ProcFillchar, MK_ALL, 0, #if defined( _OS2 ) || defined( _EXE ) || defined( _DOS16M ) || defined( _QNX ) - "PACKCode", ProcPackcode, (MK_OS2_16BIT | MK_DOS | MK_QNX | MK_DOS16M), 0, - "PACKData", ProcPackdata, (MK_OS2_16BIT | MK_DOS | MK_QNX | MK_DOS16M), 0, + "PACKCode", ProcPackcode, (MK_OS2_NE | MK_WIN_NE | MK_DOS | MK_QNX | MK_DOS16M), 0, + "PACKData", ProcPackdata, (MK_OS2_NE | MK_WIN_NE | MK_DOS | MK_QNX | MK_DOS16M), 0, #endif #if defined( _OS2 ) || defined( _ELF ) - "Alignment", ProcAlignment, (MK_OS2_16BIT | MK_OS2_LX | MK_PE | MK_ELF), 0, + "Alignment", ProcAlignment, (MK_OS2_NE | MK_WIN_NE | MK_OS2_LX | MK_PE | MK_ELF), 0, #endif #if defined( _OS2 ) || defined( _PHARLAP ) || defined( _DOS16M ) - "STUB", ProcStub, (MK_OS2 | MK_PE | MK_WIN_VXD | MK_PHAR_LAP | MK_DOS16M), 0, + "STUB", ProcStub, (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD | MK_PHAR_LAP | MK_DOS16M), 0, #endif #if defined( _OS2 ) || defined( _NOVELL ) - "DEscription", ProcDescription, MK_OS2 | MK_PE | MK_WIN_VXD | MK_NOVELL, 0, + "DEscription", ProcDescription, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD | MK_NOVELL, 0, #endif #if defined( _OS2 ) || defined( _QNX ) - "Heapsize", ProcHeapSize, (MK_OS2 | MK_QNX | MK_PE), 0, + "Heapsize", ProcHeapSize, (MK_OS2 | MK_WIN_NE | MK_QNX | MK_PE), 0, #endif #if defined(_PHARLAP) || defined(_QNX) || defined(_OS2) || defined(_RAW) - "OFFset", ProcOffset, MK_PHAR_FLAT | MK_OS2_FLAT | MK_PE | MK_QNX_FLAT | MK_ELF | MK_RAW, 0, + "OFFset", ProcOffset, MK_PHAR_FLAT | MK_OS2_FLAT | MK_WIN_VXD | MK_PE | MK_QNX_FLAT | MK_ELF | MK_RAW, 0, #endif #if defined( _OS2 ) || defined( _NOVELL ) - "VERSion", ProcVersion, MK_NOVELL | MK_OS2_FLAT | MK_PE | MK_WINDOWS, 0, - "IMPLib", ProcImplib, MK_NOVELL | MK_OS2 | MK_PE, 0, - "IMPFile", ProcImpFile, MK_NOVELL | MK_OS2 | MK_PE, 0, + "VERSion", ProcVersion, MK_NOVELL | MK_OS2_FLAT | MK_WIN_VXD | MK_PE | MK_WIN_NE, 0, + "IMPLib", ProcImplib, MK_NOVELL | MK_OS2 | MK_WIN_NE | MK_PE, 0, + "IMPFile", ProcImpFile, MK_NOVELL | MK_OS2 | MK_WIN_NE | MK_PE, 0, #endif #if defined( _DOS16M ) || defined( _QNX ) || defined( _OS2 ) || defined( _ELF ) "NORelocs", ProcNoRelocs, (MK_QNX | MK_DOS16M | MK_PE | MK_ELF), 0, @@ -2047,8 +2047,8 @@ static parse_entry Models[] = { "Dos", ProcDosFormat, MK_DOS, 0, #endif #ifdef _OS2 - "OS2", ProcOS2Format, MK_ONLY_OS2, 0, - "WINdows", ProcWindowsFormat, MK_WINDOWS | MK_PE | MK_WIN_VXD, 0, + "OS2", ProcOS2Format, MK_OS2, 0, + "WINdows", ProcWindowsFormat, MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, #endif #ifdef _PHARLAP "PHARlap", ProcPharFormat, MK_PHAR_LAP, 0, @@ -2118,14 +2118,14 @@ static parse_entry Directives[] = { #ifdef _OS2 "RESource", ProcResource, MK_PE, 0, "COMmit", ProcCommit, MK_PE, 0, - "ANONymousexport",ProcAnonExport, MK_OS2, CF_AFTER_INC, + "ANONymousexport",ProcAnonExport, MK_OS2 | MK_WIN_NE, CF_AFTER_INC, #endif #if defined( _NOVELL ) || defined( _OS2 ) || defined( _ELF ) - "IMPort", ProcImport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_PE), CF_AFTER_INC, - "EXPort", ProcExport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_PE | MK_WIN_VXD), CF_AFTER_INC, + "IMPort", ProcImport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_WIN_NE | MK_PE), CF_AFTER_INC, + "EXPort", ProcExport, (MK_NOVELL | MK_ELF | MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD), CF_AFTER_INC, #endif #if defined( _OS2 ) || defined( _QNX ) - "SEGment", ProcSegment, (MK_QNX | MK_OS2 | MK_PE | MK_WIN_VXD ), CF_SUBSET, + "SEGment", ProcSegment, (MK_QNX | MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD ), CF_SUBSET, #endif #ifdef _EXE "OVerlay", ProcOverlay, MK_OVERLAYS, 0, @@ -2146,7 +2146,7 @@ static parse_entry Directives[] = { "TRansparent", Proc16MTransparent, MK_DOS16M, CF_SUBSET, #endif #if defined( _OS2 ) || defined( _EXE ) || defined ( _QNX ) - "NEWsegment", ProcNewSegment, (MK_OS2_16BIT | MK_DOS | MK_QNX), 0, + "NEWsegment", ProcNewSegment, (MK_OS2_NE | MK_WIN_NE | MK_DOS | MK_QNX), 0, #endif #ifdef DEVBUILD "Xdbg", ProcXDbg, MK_ALL, 0, diff --git a/bld/wl/c/cmdline.c b/bld/wl/c/cmdline.c index bc49523250..9ee7305ec8 100644 --- a/bld/wl/c/cmdline.c +++ b/bld/wl/c/cmdline.c @@ -104,7 +104,7 @@ static const select_format PossibleFmt[] = { MK_ELF, "LIBELF", SetELFFmt, FreeELFFmt, #endif #ifdef _OS2 - MK_WINDOWS, "LIBWIN", SetOS2Fmt, FreeOS2Fmt, + MK_WIN_NE, "LIBWIN", SetOS2Fmt, FreeOS2Fmt, MK_OS2_NE, "LIBOS2", SetOS2Fmt, FreeOS2Fmt, MK_OS2_LE, "LIBOS2FLAT", SetOS2Fmt, FreeOS2Fmt, MK_OS2_LX, "LIBOS2FLAT", SetOS2Fmt, FreeOS2Fmt, @@ -327,17 +327,17 @@ void DoCmdFile( const char *fname ) if( (LinkState & LS_FMT_DECIDED) == 0 ) { /* restrict set to automatically decided ones */ #if defined( __QNX__ ) -#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_QNX ) +#define LAST_CHANCE ( MK_OS2 | MK_QNX ) #elif defined( __LINUX__ ) -#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_ELF ) +#define LAST_CHANCE ( MK_OS2 | MK_ELF ) #elif defined( __BSD__ ) -#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_ELF ) +#define LAST_CHANCE ( MK_OS2 | MK_ELF ) #elif defined( __NT__ ) -#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_NE | MK_WINDOWS | MK_PE | MK_DOS_EXE | MK_WIN_VXD ) +#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_NE | MK_WIN_NE | MK_PE | MK_DOS_EXE | MK_WIN_VXD ) #elif defined( __RDOS__ ) #define LAST_CHANCE ( MK_RDOS | MK_PE | MK_DOS_EXE) #else -#define LAST_CHANCE ( MK_OS2_LX | MK_OS2_LE | MK_OS2_NE | MK_DOS_EXE | MK_PHAR_SIMPLE ) +#define LAST_CHANCE ( MK_OS2 | MK_DOS_EXE | MK_PHAR_SIMPLE ) #endif HintFormat( LAST_CHANCE ); } else { @@ -492,7 +492,7 @@ bool HintFormat( exe_format hint ) } if( possible == 0 ) { #ifdef _OS2 - if( (~(MK_OS2 | MK_PE | MK_WIN_VXD) & FmtData.type) == 0 ) { + if( (~(MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) & FmtData.type) == 0 ) { /* Windows, OS/2 V1.x, OS/2 V2.x, PE, VxD all want the same structure */ InitFmt( SetOS2Fmt ); diff --git a/bld/wl/c/cmdos2.c b/bld/wl/c/cmdos2.c index f68035707c..1d042cc141 100644 --- a/bld/wl/c/cmdos2.c +++ b/bld/wl/c/cmdos2.c @@ -71,7 +71,7 @@ void SetOS2Fmt( void ) FmtData.description = NULL; FmtData.u.os2fam.exports = NULL; FmtData.u.os2fam.old_lib_name = NULL; - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { FmtData.def_seg_flags |= SEG_PRELOAD; } ChkBase( _64K ); @@ -372,16 +372,16 @@ static bool ProcMixed1632( void ) } static parse_entry MainOptions[] = { - "NOSTUB", ProcNoStub, MK_OS2 | MK_PE | MK_WIN_VXD, 0, - "ONEautodata", ProcSingle, MK_OS2, CF_AUTO_SEG_FLAG, - "MANYautodata", ProcMultiple, MK_OS2, CF_AUTO_SEG_FLAG, - "NOAutodata", ProcNone, MK_OS2_16BIT, CF_AUTO_SEG_FLAG, - "OLDlibrary", ProcOldLibrary, MK_OS2 | MK_PE, 0, - "MODName", ProcModName, MK_OS2 | MK_PE | MK_WIN_VXD, 0, - "NEWFiles", ProcNewFiles, MK_ONLY_OS2_16, 0, - "PROTmode", ProcProtMode, MK_OS2_16BIT, 0, + "NOSTUB", ProcNoStub, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, + "ONEautodata", ProcSingle, MK_OS2 | MK_WIN_NE, CF_AUTO_SEG_FLAG, + "MANYautodata", ProcMultiple, MK_OS2 | MK_WIN_NE, CF_AUTO_SEG_FLAG, + "NOAutodata", ProcNone, MK_OS2_NE | MK_WIN_NE, CF_AUTO_SEG_FLAG, + "OLDlibrary", ProcOldLibrary, MK_OS2 | MK_WIN_NE | MK_PE, 0, + "MODName", ProcModName, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, + "NEWFiles", ProcNewFiles, MK_OS2_NE, 0, + "PROTmode", ProcProtMode, MK_OS2_NE | MK_WIN_NE, 0, "NOSTDCall", ProcNoStdCall, MK_PE, 0, - "RWReloccheck", ProcRWRelocCheck, MK_WINDOWS, 0, + "RWReloccheck", ProcRWRelocCheck, MK_WIN_NE, 0, "SELFrelative", ProcSelfRelative, MK_OS2_LX, 0, "INTernalrelocs", ProcInternalRelocs, MK_OS2_LX, 0, "TOGglerelocsflag", ProcToggleRelocsFlag, MK_OS2_LX, 0, @@ -390,7 +390,7 @@ static parse_entry MainOptions[] = { "CHECKSUM", ProcChecksum, MK_PE, 0, "LARGEaddressaware", ProcLargeAddressAware, MK_PE, 0, "NOLARGEaddressaware", ProcNoLargeAddressAware, MK_PE, 0, - "MIXed1632", ProcMixed1632, MK_OS2_FLAT, 0, + "MIXed1632", ProcMixed1632, MK_OS2_FLAT | MK_WIN_VXD, 0, NULL }; @@ -535,8 +535,8 @@ static bool ProcPrivate( void ) } static parse_entry Exp_Keywords[] = { - "RESident", ProcExpResident, MK_OS2, 0, - "PRIVATE", ProcPrivate, MK_OS2 | MK_PE, 0, + "RESident", ProcExpResident, MK_OS2 | MK_WIN_NE, 0, + "PRIVATE", ProcPrivate, MK_OS2 | MK_WIN_NE | MK_PE, 0, NULL }; @@ -578,7 +578,7 @@ static bool getexport( void ) } FmtData.u.os2fam.exports = exp->next; // take it off the list exp->iopl_words = 0; - if( (FmtData.type & (MK_WINDOWS | MK_PE)) == 0 && GetToken( SEP_NO, TOK_INCLUDE_DOT ) ) { + if( (FmtData.type & (MK_WIN_NE | MK_PE)) == 0 && GetToken( SEP_NO, TOK_INCLUDE_DOT ) ) { if( getatoi( &val16 ) == ST_IS_ORDINAL ) { if( val16 > 63 ) { LnkMsg( LOC+LINE+MSG_TOO_MANY_IOPL_WORDS+ ERR, NULL ); @@ -653,8 +653,8 @@ static bool ProcSegData( void ) } static parse_entry SegTypeDesc[] = { - "CODE", ProcSegCode, MK_OS2 | MK_PE | MK_WIN_VXD, 0, - "DATA", ProcSegData, MK_OS2 | MK_PE | MK_WIN_VXD, 0, + "CODE", ProcSegCode, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, + "DATA", ProcSegData, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, NULL }; @@ -902,34 +902,34 @@ static bool ProcNonPageable( void ) } static parse_entry SegDesc[] = { - "Class", ProcOS2Class, MK_OS2 | MK_PE | MK_WIN_VXD, 0, - "TYpe", ProcSegType, MK_OS2 | MK_PE | MK_WIN_VXD, 0, + "Class", ProcOS2Class, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, + "TYpe", ProcSegType, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, NULL }; static parse_entry SegModel[] = { - "PReload", ProcPreload, MK_OS2 | MK_WIN_VXD, 0, - "LOadoncall", ProcLoadoncall, MK_OS2 | MK_WIN_VXD, 0, - "Iopl", ProcIopl, MK_ONLY_OS2 | MK_WIN_VXD, 0, - "NOIopl", ProcNoIopl, MK_ONLY_OS2 | MK_WIN_VXD, 0, - "EXECUTEOnly", ProcExecuteonly, MK_OS2, 0, - "EXECUTERead", ProcExecuteread, MK_OS2, 0, - "SHared", ProcShared, MK_OS2 | MK_PE | MK_WIN_VXD, 0, - "NONShared", ProcNonShared, MK_OS2 | MK_PE | MK_WIN_VXD, 0, - "READOnly", ProcReadOnly, MK_OS2, 0, - "READWrite", ProcReadWrite, MK_OS2, 0, - "CONforming", ProcConforming, MK_ONLY_OS2 | MK_WIN_VXD, 0, - "NONConforming", ProcNonConforming, MK_ONLY_OS2 | MK_WIN_VXD, 0, - "MOVeable", ProcMovable, MK_OS2_16BIT, 0, - "FIXed", ProcFixed, MK_WINDOWS, 0, - "DIScardable", ProcDiscardable, MK_WINDOWS | MK_WIN_VXD, 0, + "PReload", ProcPreload, MK_OS2 | MK_WIN_NE | MK_WIN_VXD, 0, + "LOadoncall", ProcLoadoncall, MK_OS2 | MK_WIN_NE | MK_WIN_VXD, 0, + "Iopl", ProcIopl, MK_OS2 | MK_WIN_VXD, 0, + "NOIopl", ProcNoIopl, MK_OS2 | MK_WIN_VXD, 0, + "EXECUTEOnly", ProcExecuteonly, MK_OS2 | MK_WIN_NE, 0, + "EXECUTERead", ProcExecuteread, MK_OS2 | MK_WIN_NE, 0, + "SHared", ProcShared, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, + "NONShared", ProcNonShared, MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD, 0, + "READOnly", ProcReadOnly, MK_OS2 | MK_WIN_NE, 0, + "READWrite", ProcReadWrite, MK_OS2 | MK_WIN_NE, 0, + "CONforming", ProcConforming, MK_OS2 | MK_WIN_VXD, 0, + "NONConforming", ProcNonConforming, MK_OS2 | MK_WIN_VXD, 0, + "MOVeable", ProcMovable, MK_OS2_NE | MK_WIN_NE, 0, + "FIXed", ProcFixed, MK_WIN_NE, 0, + "DIScardable", ProcDiscardable, MK_WIN_NE | MK_WIN_VXD, 0, "NONDiscardable", ProcNonDiscardable, MK_WIN_VXD, 0, - "INValid", ProcInvalid, MK_OS2_LE | MK_OS2_LX, 0, - "RESident", ProcPermanent, MK_OS2_LE | MK_OS2_LX | MK_WIN_VXD, 0, - "CONTiguous", ProcContiguous, MK_OS2_LE | MK_OS2_LX, 0, - "DYNamic", ProcOS2Dynamic, MK_OS2_LE | MK_OS2_LX, 0, - "PERManent", ProcPermanent, MK_OS2_LE | MK_OS2_LX, 0, - "NONPERManent", ProcNonPermanent, MK_OS2_LE | MK_OS2_LX, 0, + "INValid", ProcInvalid, MK_OS2_FLAT, 0, + "RESident", ProcPermanent, MK_OS2_FLAT | MK_WIN_VXD, 0, + "CONTiguous", ProcContiguous, MK_OS2_FLAT, 0, + "DYNamic", ProcOS2Dynamic, MK_OS2_FLAT, 0, + "PERManent", ProcPermanent, MK_OS2_FLAT, 0, + "NONPERManent", ProcNonPermanent, MK_OS2_FLAT, 0, "PAGEable", ProcPageable, MK_PE, 0, "NONPageable", ProcNonPageable, MK_PE, 0, NULL @@ -1161,15 +1161,15 @@ static bool ProcTermThread( void ) } static parse_entry Init_Keywords[] = { - "INITGlobal", ProcInitGlobal, MK_OS2 | MK_PE, 0, - "INITInstance", ProcInitInstance, MK_OS2 | MK_PE, 0, + "INITGlobal", ProcInitGlobal, MK_OS2 | MK_WIN_NE | MK_PE, 0, + "INITInstance", ProcInitInstance, MK_OS2 | MK_WIN_NE | MK_PE, 0, "INITThread", ProcInitThread, MK_PE, 0, NULL }; static parse_entry Term_Keywords[] = { - "TERMGlobal", ProcTermGlobal, MK_OS2_LE | MK_OS2_LX | MK_PE, 0, - "TERMInstance", ProcTermInstance, MK_OS2_LE | MK_OS2_LX | MK_PE, 0, + "TERMGlobal", ProcTermGlobal, MK_OS2_FLAT | MK_PE, 0, + "TERMInstance", ProcTermInstance, MK_OS2_FLAT | MK_PE, 0, "TERMThread", ProcTermThread, MK_PE, 0, NULL }; @@ -1179,7 +1179,7 @@ static bool ProcOS2DLL( void ) { FmtData.def_ext = E_DLL; FmtData.dll = true; - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { FmtData.u.os2fam.flags &= ~MULTIPLE_AUTO_DATA; FmtData.u.os2fam.flags |= SINGLE_AUTO_DATA; FmtData.def_seg_flags |= SEG_PURE | SEG_MOVABLE; @@ -1311,13 +1311,13 @@ static bool ProcVirtDevice( void ) } static parse_entry WindowsFormatOptions[] = { - "MEMory", ProcMemory, MK_WINDOWS, 0, - "FOnt", ProcFont, MK_WINDOWS, 0, + "MEMory", ProcMemory, MK_WIN_NE, 0, + "FOnt", ProcFont, MK_WIN_NE, 0, NULL }; static parse_entry WindowsSubFormats[] = { - "DLl", ProcOS2DLL, MK_WINDOWS | MK_PE, 0, + "DLl", ProcOS2DLL, MK_WIN_NE | MK_PE, 0, NULL }; @@ -1329,12 +1329,12 @@ static parse_entry WindowsFormats[] = { }; static parse_entry OS2SubFormats[] = { - "DLl", ProcOS2DLL, MK_ONLY_OS2, 0, - "PHYSdevice", ProcPhysDevice, MK_OS2_LE | MK_OS2_LX, 0, - "VIRTdevice", ProcVirtDevice, MK_OS2_LE | MK_OS2_LX, 0, - "PM", ProcPM, MK_ONLY_OS2, 0, - "PMCompatible", ProcPMCompatible, MK_ONLY_OS2, 0, - "FULLscreen", ProcPMFullscreen, MK_ONLY_OS2, 0, + "DLl", ProcOS2DLL, MK_OS2, 0, + "PHYSdevice", ProcPhysDevice, MK_OS2_FLAT, 0, + "VIRTdevice", ProcVirtDevice, MK_OS2_FLAT, 0, + "PM", ProcPM, MK_OS2, 0, + "PMCompatible", ProcPMCompatible, MK_OS2, 0, + "FULLscreen", ProcPMFullscreen, MK_OS2, 0, NULL }; @@ -1358,8 +1358,8 @@ bool ProcOS2Format( void ) FmtData.u.os2fam.gen_int_relocs = true; } } - if( FmtData.type & MK_ONLY_OS2_16 ) { // if no 32-bit thing specd - HintFormat( MK_ONLY_OS2_16 ); // make sure 16-bit is what we get + if( FmtData.type & MK_OS2_NE ) { // if no 32-bit thing specd + HintFormat( MK_OS2_NE ); // make sure 16-bit is what we get if( FmtData.dll ) { FmtData.u.os2fam.flags &= ~MULTIPLE_AUTO_DATA; FmtData.u.os2fam.flags |= SINGLE_AUTO_DATA; @@ -1376,7 +1376,7 @@ bool ProcWindowsFormat( void ) FmtData.def_ext = E_LOAD; ProcOne( WindowsFormats, SEP_NO ); ProcOne( WindowsSubFormats, SEP_NO ); - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { while( ProcOne( WindowsFormatOptions, SEP_NO ) ) { // loop all options } diff --git a/bld/wl/c/loadelf.c b/bld/wl/c/loadelf.c index 6ea29b328a..c4703bfd1b 100644 --- a/bld/wl/c/loadelf.c +++ b/bld/wl/c/loadelf.c @@ -379,7 +379,7 @@ void FiniELFLoadFile( void ) SetHeaders( &hdr ); #if 0 - if( (LinkState & LS_HAVE_PPC_CODE) && (FmtData.type & MK_OS2) ) { + if( (LinkState & LS_HAVE_PPC_CODE) && (FmtData.type & (MK_OS2 | MK_WIN_NE)) ) { // Development temporarly on hold // BuildOS2Imports(); // Build .got section } diff --git a/bld/wl/c/loadfile.c b/bld/wl/c/loadfile.c index 5cd71bebee..1566863010 100644 --- a/bld/wl/c/loadfile.c +++ b/bld/wl/c/loadfile.c @@ -178,7 +178,7 @@ static void SetupImpLib( void ) * increase length to restore full extension if not OS2 * sometimes the extension of the output name is important */ - if( (FmtData.type & MK_OS2_16BIT) == 0 ) + if( (FmtData.type & (MK_OS2_NE | MK_WIN_NE)) == 0 ) ImpLib.module_name_len += strlen( fname + namelen ); _ChkAlloc( ImpLib.module_name, ImpLib.module_name_len ); memcpy( ImpLib.module_name, fname, ImpLib.module_name_len ); @@ -281,19 +281,19 @@ static void finiLoad( void ) #endif #ifdef _OS2 #if 0 - if( (FmtData.type & MK_OS2) && (LinkState & LS_HAVE_PPC_CODE) ) { + if( (FmtData.type & (MK_OS2 | MK_WIN_NE)) && (LinkState & LS_HAVE_PPC_CODE) ) { // development temporarly on hold: FiniELFLoadFile(); return; } #endif - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { FiniOS2FlatLoadFile(); return; } else if( FmtData.type & MK_PE ) { FiniPELoadFile(); return; - } else if( FmtData.type & MK_OS2_16BIT ) { + } else if( FmtData.type & (MK_OS2_NE | MK_WIN_NE) ) { FiniOS2LoadFile(); return; } @@ -407,7 +407,7 @@ void GetStkAddr( void ) StackAddr.off = StackSegPtr->seg_addr.off + StackSegPtr->size; } else { #ifdef _OS2 - if( (FmtData.type & MK_WINDOWS) && (LinkFlags & LF_STK_SIZE_FLAG) ) { + if( (FmtData.type & MK_WIN_NE) && (LinkFlags & LF_STK_SIZE_FLAG) ) { PhoneyStack(); } else { #endif diff --git a/bld/wl/c/loadflat.c b/bld/wl/c/loadflat.c index 7c46847821..521b0c0e82 100644 --- a/bld/wl/c/loadflat.c +++ b/bld/wl/c/loadflat.c @@ -568,7 +568,7 @@ void FiniOS2FlatLoadFile( void ) exe_head.flags |= OSF_LINK_ERROR; } if( (FmtData.type & MK_OS2_LX) - && (FmtData.u.os2fam.toggle_relocs ^ FmtData.u.os2fam.gen_int_relocs) ) { + && (FmtData.u.os2fam.toggle_relocs ^ FmtData.u.os2fam.gen_int_relocs) ) { exe_head.flags |= OSF_INTERNAL_FIXUPS_DONE; } exe_head.heapsize = FmtData.u.os2fam.heapsize; diff --git a/bld/wl/c/loados2.c b/bld/wl/c/loados2.c index 5c81ddf5f2..f98052fc40 100644 --- a/bld/wl/c/loados2.c +++ b/bld/wl/c/loados2.c @@ -570,7 +570,7 @@ static unsigned long ModRefTable( void ) unsigned long nodenum; unsigned long off; - if( FmtData.type & MK_OS2_16BIT ) { + if( FmtData.type & (MK_OS2_NE | MK_WIN_NE) ) { off = 1; for( inode = FmtData.u.os2fam.imp_tab_list; inode != NULL; inode = inode->next ) { off += inode->len + 1; @@ -627,7 +627,7 @@ unsigned long ResNonResNameTable( bool dores ) } else { /* in non-resident names table */ if( FmtData.description != NULL ) { name = FmtData.description; - } else if( FmtData.type & MK_OS2_16BIT ) { + } else if( FmtData.type & (MK_OS2_NE | MK_WIN_NE) ) { name = Root->outfile->fname; } else { name = ""; @@ -868,7 +868,7 @@ void ChkOS2Exports( void ) } else { exp->addr = sym->addr; if( sym->p.seg == NULL || IS_SYM_IMPORTED( sym ) ) { - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { // MN: Create a forwarder - add a special flag? // Currently WriteFlatEntryTable() in loadflat.c will // recognize a forwarder by segment == 0xFFFF @@ -877,7 +877,7 @@ void ChkOS2Exports( void ) } } else { group = sym->p.seg->u.leader->group; - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { exp->addr.off -= group->grp_addr.off; if( (group->segflags & SEG_LEVEL_MASK) == SEG_LEVEL_2 ) { exp->isiopl = true; // Conforming or not doesn't matter! @@ -1096,7 +1096,7 @@ void FiniOS2LoadFile( void ) exe_head.version = 0x0105; /* version 5.1 */ exe_head.chk_sum = 0L; exe_head.info = 0; - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { exe_head.target = TARGET_WINDOWS; } else { exe_head.target = TARGET_OS2; @@ -1180,7 +1180,7 @@ void FiniOS2LoadFile( void ) exe_head.otherflags |= WIN_GANGLOAD_PRESENT; } exe_head.swaparea = 0; - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { if( FmtData.ver_specified ) { exe_head.expver = (FmtData.major << 8) | (FmtData.minor & 0xFF); } else { @@ -1194,7 +1194,7 @@ void FiniOS2LoadFile( void ) * tweak the default heap/stack size so this check isn't bulletproof. */ dgroup_total = dgroup_size + exe_head.stack + exe_head.heap; - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { if( dgroup_total > (MAX_DGROUP_SIZE - 3) ) { LnkMsg( FTL+MSG_DEFDATA_TOO_BIG, "l", dgroup_total - MAX_DGROUP_SIZE + 3 ); diff --git a/bld/wl/c/loadraw.c b/bld/wl/c/loadraw.c index e6e4af6e84..0cada79705 100644 --- a/bld/wl/c/loadraw.c +++ b/bld/wl/c/loadraw.c @@ -106,7 +106,7 @@ void BinOutput( void ) #endif #if defined( _OS2 ) || defined( _QNX ) || defined( _ELF ) - if( FmtData.type & (MK_PE | MK_QNX_FLAT | MK_OS2_FLAT | MK_ELF) ) { + if( FmtData.type & (MK_PE | MK_QNX_FLAT | MK_OS2_FLAT | MK_WIN_VXD | MK_ELF) ) { CurrSect = Root; // needed for WriteInfo. Root->sect_addr = Groups->grp_addr; fnode = Root->outfile; @@ -341,7 +341,7 @@ void HexOutput( void ) buf_offset = 0; #if defined( _OS2 ) || defined( _QNX ) || defined( _ELF ) - if( FmtData.type & (MK_PE | MK_QNX_FLAT | MK_OS2_FLAT | MK_ELF) ) { + if( FmtData.type & (MK_PE | MK_QNX_FLAT | MK_OS2_FLAT | MK_WIN_VXD | MK_ELF) ) { CurrSect = Root; // needed for WriteInfo. Root->sect_addr = Groups->grp_addr; fnode = Root->outfile; diff --git a/bld/wl/c/lsymtab.c b/bld/wl/c/lsymtab.c index 0c23499275..08c02a055f 100644 --- a/bld/wl/c/lsymtab.c +++ b/bld/wl/c/lsymtab.c @@ -1165,7 +1165,7 @@ void XWriteImports( void ) WriteFormat( 0, "%s", sym->name ); } #ifdef _OS2 - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { WriteFormat( 36, "%s", ImpModuleName( sym->p.import ) ); } #endif diff --git a/bld/wl/c/mapio.c b/bld/wl/c/mapio.c index 8710289291..9b0535bce9 100644 --- a/bld/wl/c/mapio.c +++ b/bld/wl/c/mapio.c @@ -374,7 +374,7 @@ static void WriteModSegHead( void ) static void WriteImports( void ) /******************************/ { - if( FmtData.type & (MK_NOVELL | MK_OS2 | MK_PE) ) { + if( FmtData.type & (MK_NOVELL | MK_OS2 | MK_WIN_NE | MK_PE) ) { WriteBox( MSG_MAP_BOX_IMP_SYM ); if( FmtData.type & (MK_NOVELL | MK_ELF) ) { Msg_Write_Map( MSG_MAP_TITLE_IMP_SYM_0 ); @@ -868,7 +868,7 @@ static const char *getStubName( void ) if( FmtData.u.os2fam.no_stub ) { return( "none" ); } - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { return( FmtData.u.os2fam.stub_file_name ); } #endif diff --git a/bld/wl/c/msg.c b/bld/wl/c/msg.c index 16fbef54df..91939073d0 100644 --- a/bld/wl/c/msg.c +++ b/bld/wl/c/msg.c @@ -2,7 +2,7 @@ * * Open Watcom Project * -* Copyright (c) 2002-2022 The Open Watcom Contributors. All Rights Reserved. +* Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved. * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== @@ -187,7 +187,7 @@ static size_t fmtAddr( char *dest, size_t len, targ_addr *addr, bool offs_32 ) } #endif /* segmented formats 16:16 or 16:32 */ - if( !offs_32 && (FmtData.type & (MK_DOS | MK_OS2_16BIT | MK_DOS16M | MK_QNX_16 | MK_RDOS_16)) ) { + if( !offs_32 && (FmtData.type & (MK_DOS | MK_OS2_NE | MK_WIN_NE | MK_DOS16M | MK_QNX_16 | MK_RDOS_16)) ) { return( FmtStr( dest, len, "%x:%x", addr->seg, (unsigned short)addr->off ) ); } else { return( FmtStr( dest, len, "%x:%h", addr->seg, addr->off ) ); diff --git a/bld/wl/c/obj2supp.c b/bld/wl/c/obj2supp.c index 3a937567ba..cb0efe8cc1 100644 --- a/bld/wl/c/obj2supp.c +++ b/bld/wl/c/obj2supp.c @@ -404,7 +404,7 @@ static void CheckRWData( target_spec *target, targ_addr *addr ) { symbol sym; - if( (FmtData.type & MK_WINDOWS) + if( (FmtData.type & MK_WIN_NE) && FmtData.u.os2fam.chk_seg_relocs && IsReadOnly( LastSegData ) ) { if( !IS_SYM_IMPORTED( target->u.sym ) && !IsReadOnly( GetTargetSegData( target ) ) ) { @@ -667,7 +667,7 @@ static void DumpReloc( base_reloc *breloc ) { WriteReloc( CurrRec.seg->u.leader->group, breloc->fix_off, &breloc->item, breloc->rel_size ); #ifdef _OS2 - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { if( ( OSF_PAGE_SIZE - (breloc->fix_off & OSF_PAGE_MASK) ) < breloc->fix_size ) { /* * stupid relocation has been split across two @@ -828,7 +828,7 @@ static bool CheckSpecials( fix_relo_data *fix, target_spec *target ) } #endif #ifdef _OS2 - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { if( fix->fpp_type != FPP_IGNORE ) { MakeWindowsFloatReloc( fix ); } @@ -870,7 +870,7 @@ static bool CheckSpecials( fix_relo_data *fix, target_spec *target ) if( (fix->type & FIX_REL) == 0 ) return( false ); #ifdef _OS2 - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { /* * OS/2 V2 relative fixups to imported items or other objects * require special handling @@ -892,7 +892,7 @@ static bool CheckSpecials( fix_relo_data *fix, target_spec *target ) } if( fix->imported ) { #ifdef _OS2 - if( FmtData.type & MK_OS2_16BIT ) { // can not get at a DLL relatively + if( FmtData.type & (MK_OS2_NE | MK_WIN_NE) ) { // can not get at a DLL relatively LnkMsg( LOC+ERR+MSG_DLL_IN_REL_RELOC, "a", &fix->loc_addr ); return( true ); } @@ -920,7 +920,7 @@ static bool CheckSpecials( fix_relo_data *fix, target_spec *target ) return( true ); } /* XXX: MK_ELF must not be included for non-i386 */ - if( FmtData.type & (MK_PROT_MODE & ~(MK_OS2_FLAT | MK_PE | MK_ELF)) ) { + if( FmtData.type & (MK_PROT_MODE & ~(MK_OS2_FLAT | MK_WIN_VXD | MK_PE | MK_ELF)) ) { if( ( fix->loc_addr.seg != fix->tgt_addr.seg ) && (fix->type & FIX_ABS) == 0 ) { //must have same file segment. if( FmtData.type & MK_ID_SPLIT ) { @@ -986,7 +986,7 @@ static offset FindRealAddr( fix_relo_data *fix ) || dbiflat && (CurrMod->modinfo & MOD_FLATTEN_DBI) == 0 ) { return( off ); } - if( (FmtData.type & (MK_OS2_FLAT | MK_LINEARIZE | MK_QNX_FLAT)) + if( (FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD | MK_LINEARIZE | MK_QNX_FLAT)) && (fix->type & FIX_SEC_REL) == 0 ) { if( (FmtData.type & (MK_OS2_LE | MK_WIN_VXD)) && !dbiflat ) return( off ); @@ -1027,7 +1027,7 @@ static void PatchData( fix_relo_data *fix ) data = fix->data; fix->additive = false; - if( fix->imported && (FmtData.type & MK_OS2_FLAT) ) { + if( fix->imported && (FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD)) ) { fix->value = fix->tgt_addr.off; } else { fix->value = 0; @@ -1047,7 +1047,7 @@ static void PatchData( fix_relo_data *fix ) * Catch the ELF FIX_NOADJ cases CheckSpecials didn't handle. * NB: Other fixup types besides LX imports likely need the same treatment. */ - if( (fix->type & FIX_NOADJ) && fix->imported && (FmtData.type & MK_OS2_FLAT) ) { + if( (fix->type & FIX_NOADJ) && fix->imported && (FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD)) ) { fix->value += CalcFixupSize( fix->type ); fix->type &= FIX_NOADJ; /* This flag isn't interesting anymore. */ } @@ -1068,16 +1068,16 @@ static void PatchData( fix_relo_data *fix ) fix->done = true; } if( (fix->type & FIX_BASE) == 0 ) { // it's offset only - if( !( (FmtData.type & MK_WINDOWS) && (fix->type & FIX_LOADER_RES) ) ) { + if( !( (FmtData.type & MK_WIN_NE) && (fix->type & FIX_LOADER_RES) ) ) { PatchOffset( fix, FindRealAddr( fix ), false ); - if( (FmtData.type & (MK_ELF | MK_QNX | MK_PE | MK_OS2_FLAT | MK_NOVELL | MK_PHAR_REX | MK_ZDOS | MK_RAW)) == 0 + if( (FmtData.type & (MK_ELF | MK_QNX | MK_PE | MK_OS2_FLAT | MK_WIN_VXD | MK_NOVELL | MK_PHAR_REX | MK_ZDOS | MK_RAW)) == 0 || (FmtData.type & MK_OS2_LX) && !FmtData.u.os2fam.gen_int_relocs ) { fix->done = true; } } } else { // its a seg reloc and maybe an offset as well. if( (fix->type & FIX_OFFSET_MASK) != FIX_NO_OFFSET ) { - if( !fix->done && (FmtData.type & (MK_OS2 | MK_WIN_VXD)) ) + if( !fix->done && (FmtData.type & (MK_OS2 | MK_WIN_NE | MK_WIN_VXD)) ) return; PatchOffset( fix, FindRealAddr( fix ), false ); data += OffsetSizes[FIX_GET_OFFSET( fix->type )]; @@ -1186,7 +1186,7 @@ static bool FarCallOpt( fix_relo_data *fix ) } else { temp16 = MGET_U16( code + 1 ); } - if( FmtData.type & (MK_OS2 | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_WIN_VXD) ) { if( is32bit ) { temp32 += fix->tgt_addr.off; // haven't done this for OS/2 } else { @@ -1329,7 +1329,7 @@ static bool formatBaseReloc( fix_relo_data *fix, target_spec *tthread, segdata * } breloc->item.pe = ( off & OSF_PAGE_MASK ) | reltype; return( save ); - } else if( FmtData.type & MK_OS2_16BIT ) { + } else if( FmtData.type & (MK_OS2_NE | MK_WIN_NE) ) { os2_reloc_item *os2item; offset off; byte *fixptr; @@ -1373,7 +1373,7 @@ static bool formatBaseReloc( fix_relo_data *fix, target_spec *tthread, segdata * MPUT_16( fixptr, 0xffff ); // end of chain indicator } return( true ); - } else if( FmtData.type & MK_OS2_FLAT ) { + } else if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { segdata *targseg; byte flags; byte fixtype; @@ -1830,7 +1830,7 @@ static void BuildReloc( save_fixup *save, target_spec *target, frame_spec *frame fix.fpp_type = GET_SYM_FPP( target->u.sym ); if( IS_SYM_IMPORTED( target->u.sym ) ) { if( FRAME_HAS_DATA( frame->type ) && ( target->u.sym != frame->u.sym ) ) { - if( FmtData.type & (MK_NOVELL | MK_OS2_FLAT | MK_PE) ) { + if( FmtData.type & (MK_NOVELL | MK_OS2_FLAT | MK_WIN_VXD | MK_PE) ) { fix.tgt_addr.seg = faddr.seg; fix.tgt_addr.off = 0; } else { @@ -1841,7 +1841,7 @@ static void BuildReloc( save_fixup *save, target_spec *target, frame_spec *frame } } if( fixtype & FIX_BASE ) { - if( FmtData.type & (MK_PROT_MODE & ~(MK_OS2_FLAT | MK_PE)) ) { + if( FmtData.type & (MK_PROT_MODE & ~(MK_OS2_FLAT | MK_WIN_VXD | MK_PE)) ) { if( faddr.seg != fix.tgt_addr.seg ) { if( FmtData.type & MK_ID_SPLIT ) { LnkMsg( LOC+ERR+MSG_NOV_NO_CODE_DATA_RELOC, "a", &fix.loc_addr ); diff --git a/bld/wl/c/objcalc.c b/bld/wl/c/objcalc.c index 8d5cf864ac..2d29b85d3d 100644 --- a/bld/wl/c/objcalc.c +++ b/bld/wl/c/objcalc.c @@ -529,7 +529,7 @@ void AllocClasses( section *sect ) CurrSect->size = size; CurrLoc = save; } else { - if( FmtData.type & (MK_PE | MK_QNX_FLAT | MK_OS2_FLAT | MK_ELF) ) { + if( FmtData.type & (MK_PE | MK_QNX_FLAT | MK_OS2_FLAT | MK_WIN_VXD | MK_ELF) ) { // flat addresses if( class->flags & CLASS_FIXED ) { class->segs->group->grp_addr.off = class->BaseAddr.off; @@ -578,7 +578,7 @@ static void FindFloatSyms( void ) if( FloatPatches[index].name != NULL ) { sym = FindISymbol( FloatPatches[index].name ); if( sym != NULL ) { - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { SET_SYM_FPP( sym, FloatPatches[index].win_fpp ); } else { SET_SYM_FPP( sym, FloatPatches[index].fpp ); @@ -824,7 +824,7 @@ static void setDefBase( void ) FmtData.base = PE_DEFAULT_BASE; return; } - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { FmtData.base = FLAT_GRANULARITY; return; } @@ -888,7 +888,7 @@ static void setDefObjAlign( void ) } else if( FmtData.type & MK_WIN_VXD ) { FmtData.objalign = _4K; return; - } else if( FmtData.type & MK_OS2 ) { + } else if( FmtData.type & (MK_OS2 | MK_WIN_NE) ) { #if 0 if( (LinkState & LS_HAVE_PPC_CODE) ) { // Development temporarly on hold: @@ -977,7 +977,7 @@ void CalcAddresses( void ) } else if( FmtData.type & MK_DOS16M ) { CalcGrpSegs(); #endif - } else if( FmtData.type & (MK_PE | MK_OS2_FLAT | MK_QNX_FLAT | MK_ELF) ) { + } else if( FmtData.type & (MK_PE | MK_OS2_FLAT | MK_WIN_VXD | MK_QNX_FLAT | MK_ELF) ) { flat = getFlatOffset(); for( grp = Groups; grp != NULL; grp = grp->next_group ) { size = grp->totalsize; @@ -996,7 +996,7 @@ void CalcAddresses( void ) flat = __ROUND_UP_SIZE( flat + size, FmtData.objalign ); } ReallocFileSegs(); - } else if( FmtData.type & (MK_QNX_16 | MK_OS2_16BIT) ) { + } else if( FmtData.type & (MK_QNX_16 | MK_OS2_NE | MK_WIN_NE) ) { ReallocFileSegs(); } DBIAddrStart(); diff --git a/bld/wl/c/objomf.c b/bld/wl/c/objomf.c index 7335173836..887c38e833 100644 --- a/bld/wl/c/objomf.c +++ b/bld/wl/c/objomf.c @@ -897,7 +897,7 @@ static void Comment( void ) } break; case MOMF_PROT_LIB: - if( FmtData.type & MK_WINDOWS ) { + if( FmtData.type & MK_WIN_NE ) { FmtData.u.os2fam.is_private_dll = true; } break; diff --git a/bld/wl/c/objpass1.c b/bld/wl/c/objpass1.c index 544d7fe0a3..094fcb5336 100644 --- a/bld/wl/c/objpass1.c +++ b/bld/wl/c/objpass1.c @@ -83,7 +83,7 @@ static void DoSavedImport( symbol *sym ) length_name modname; length_name extname; - if( FmtData.type & (MK_OS2 | MK_PE) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE) ) { dll = sym->p.import; sym->p.import = NULL; sym->info &= ~SYM_DEFINED; @@ -106,7 +106,7 @@ static void DoSavedExport( symbol *sym ) /* unused parameters */ (void)sym; #ifdef _OS2 - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { entry_export *exp; exp = sym->e.export; @@ -665,7 +665,7 @@ void AddSegment( segdata *sd, class_entry *class ) leader = FindALeader( sd, class, info ); if( ( (leader->info & USE_32) != (info & USE_32) ) && - !( (FmtData.type & MK_OS2_FLAT) && FmtData.u.os2fam.mixed1632 ) && + !( (FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD)) && FmtData.u.os2fam.mixed1632 ) && (FmtData.type & MK_RAW) == 0 ) { const char *segname_16; const char *segname_32; @@ -730,7 +730,7 @@ void AddToGroup( group_entry *group, seg_leader *seg ) } if( ( group->leaders != NULL ) && ( (group->leaders->info & USE_32) != (seg->info & USE_32) ) && - !( (FmtData.type & MK_OS2_FLAT) && FmtData.u.os2fam.mixed1632 ) && + !( (FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD)) && FmtData.u.os2fam.mixed1632 ) && (FmtData.type & MK_RAW) == 0 ) { const char *segname_16; @@ -1258,7 +1258,7 @@ bool SeenDLLRecord( void ) /*******************************/ { LinkState |= LS_FMT_SEEN_IMPORT_CMT; - if( !HintFormat( MK_OS2 | MK_PE | MK_ELF | MK_NOVELL ) ) { + if( !HintFormat( MK_OS2 | MK_WIN_NE | MK_PE | MK_ELF | MK_NOVELL ) ) { LnkMsg( LOC+WRN+MSG_DLL_WITH_386, NULL ); return( false ); /* Not OK to process import/export records. */ } else { @@ -1284,7 +1284,7 @@ void HandleImport( const length_name *intname, const length_name *modname, sym->mod = CurrMod; } #ifdef _OS2 - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { MSImportKeyword( sym, modname, extname, ordinal ); } else { #endif @@ -1334,7 +1334,7 @@ void HandleExport( const length_name *expname, const length_name *intname, #endif #ifdef _OS2 - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { MSExportKeyword( expname, intname, flags, ordinal ); } else { #endif diff --git a/bld/wl/c/permdata.c b/bld/wl/c/permdata.c index 28b497bb3d..3cfaf8ad08 100644 --- a/bld/wl/c/permdata.c +++ b/bld/wl/c/permdata.c @@ -339,7 +339,7 @@ static void PrepSymbol( void *_sym, void *info ) _LnkFree( save ); } } else if( IS_SYM_IMPORTED( sym ) ) { - if( FmtData.type & (MK_OS2 | MK_PE) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE) ) { sym->p.import = CarveGetIndex( CarveDLLInfo, sym->p.import ); } } else if( (sym->info & SYM_IS_ALTDEF) == 0 || IS_SYM_COMDAT( sym ) ) { @@ -347,7 +347,7 @@ static void PrepSymbol( void *_sym, void *info ) sym->u.altdefs = CarveGetIndex( CarveSymbol, sym->u.altdefs ); } if( sym->info & SYM_EXPORTED ) { - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { sym->e.export = CarveGetIndex( CarveExportInfo, sym->e.export ); } } else if( sym->e.def != NULL ) { @@ -549,7 +549,7 @@ void WritePermData( void ) hdr.numgroups = WriteGroupsList( &info ); hdr.numuserlibs = WriteLibList( &info, true ); hdr.numdeflibs = WriteLibList( &info, false ); - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { PrepNameTable( FmtData.u.os2fam.mod_ref_list, &info ); PrepNameTable( FmtData.u.os2fam.imp_tab_list, &info ); hdr.numdllsyms = WriteSmallCarve( CarveDLLInfo, MarkDLLInfo, WriteDLLInfo, &info ); @@ -733,7 +733,7 @@ static void RebuildSymbol( void *_sym, void *info ) if( IS_SYM_ALIAS( sym ) ) { sym->p.alias.u.ptr = MapString( sym->p.alias.u.offs ); } else if( IS_SYM_IMPORTED( sym ) ) { - if( FmtData.type & (MK_OS2 | MK_PE) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE) ) { sym->p.import = CarveMapIndex( CarveDLLInfo, sym->p.import ); } } else if( (sym->info & SYM_IS_ALTDEF) == 0 || IS_SYM_COMDAT( sym ) ) { @@ -741,7 +741,7 @@ static void RebuildSymbol( void *_sym, void *info ) sym->u.altdefs = CarveMapIndex( CarveSymbol, sym->u.altdefs ); } if( sym->info & SYM_EXPORTED ) { - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { sym->e.export = CarveMapIndex( CarveExportInfo, sym->e.export ); } } else if( sym->e.def != NULL ) { @@ -792,7 +792,7 @@ static void PurgeRead( perm_read_info *info ) CarvePurge( CarveModEntry ); CarvePurge( CarveSegData ); CarvePurge( CarveSymbol ); - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { CarvePurge( CarveDLLInfo ); CarvePurge( CarveExportInfo ); } @@ -875,7 +875,7 @@ void ReadPermData( void ) CarveRestart( CarveModEntry, hdr->mods.num ); CarveRestart( CarveSegData, hdr->segdatas.num ); CarveRestart( CarveSymbol, hdr->symbols.num ); - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { CarveRestart( CarveDLLInfo, hdr->numdllsyms ); CarveRestart( CarveExportInfo, hdr->numexports ); } @@ -907,7 +907,7 @@ void ReadPermData( void ) ReadGroupsList( hdr->numgroups, &info ); ReadLibList( hdr->numuserlibs, &SavedUserLibs, &info ); ReadLibList( hdr->numdeflibs, &SavedDefLibs, &info ); - if( FmtData.type & (MK_OS2 | MK_PE | MK_WIN_VXD) ) { + if( FmtData.type & (MK_OS2 | MK_WIN_NE | MK_PE | MK_WIN_VXD) ) { RebuildSmallCarve( CarveDLLInfo, hdr->numdllsyms, RebuildDLLInfo, &info ); RebuildSmallCarve( CarveExportInfo, hdr->numexports, RebuildExportInfo, &info ); } diff --git a/bld/wl/c/reloc.c b/bld/wl/c/reloc.c index 3c2b7db5e5..edddc6d60d 100644 --- a/bld/wl/c/reloc.c +++ b/bld/wl/c/reloc.c @@ -2,7 +2,7 @@ * * Open Watcom Project * -* Copyright (c) 2002-2022 The Open Watcom Contributors. All Rights Reserved. +* Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved. * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== @@ -127,7 +127,7 @@ static void *OS2PagedRelocInit( offset size, int unitsize ) static void *OS2FlatRelocInit( offset size ) /******************************************* - * initialize relocations for OS2 flat memory manager. + * initialize relocations for OS2 flat memory manager. */ { return( OS2PagedRelocInit( size, sizeof( os2_reloc_header ) ) ); @@ -191,7 +191,7 @@ void WriteReloc( group_entry *group, offset off, void *reloc, size_t size ) group->section->relocs++; return; } - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { pagelist = group->g.grp_relocs; if( pagelist == NULL ) { pagelist = OS2FlatRelocInit( group->totalsize ); @@ -216,7 +216,7 @@ void WriteReloc( group_entry *group, offset off, void *reloc, size_t size ) group->section->relocs++; return; } - if( FmtData.type & MK_OS2_16BIT ) { + if( FmtData.type & (MK_OS2_NE | MK_WIN_NE) ) { DoWriteReloc( &group->g.grp_relocs, reloc, size ); group->section->relocs++; return; @@ -273,7 +273,7 @@ static bool TraverseRelocBlock( reloc_info ** reloclist, unsigned num, while( num-- > 0 ) { if( fn( *reloclist++ ) ) return( true ); - if( FmtData.type & MK_OS2_FLAT ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD) ) { if( fn( *reloclist++ ) ) { return( true ); } @@ -325,7 +325,7 @@ static void FreeGroupRelocs( group_entry *group ) return; } #ifdef _OS2 - if( FmtData.type & (MK_OS2_FLAT | MK_PE) ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD | MK_PE) ) { TraverseOS2RelocList( group, FreeRelocList ); reloclist = group->g.grp_relocs; if( reloclist != NULL ) { @@ -340,7 +340,7 @@ static void FreeGroupRelocs( group_entry *group ) } } return; - } else if( FmtData.type & MK_OS2_16BIT ) { + } else if( FmtData.type & (MK_OS2_NE | MK_WIN_NE) ) { FreeRelocList( group->g.grp_relocs ); return; } @@ -361,7 +361,7 @@ void FreeRelocInfo( void ) if( (LinkState & LS_MAKE_RELOCS) == 0 ) return; - if( FmtData.type & (MK_ELF | MK_OS2_FLAT | MK_PE | MK_OS2_16BIT | MK_QNX) ) { + if( FmtData.type & (MK_ELF | MK_OS2_FLAT | MK_WIN_VXD | MK_PE | MK_OS2_NE | MK_WIN_NE | MK_QNX) ) { for( group = Groups; group != NULL; group = group->next_group ) { FreeGroupRelocs( group ); } @@ -458,7 +458,7 @@ void SetRelocSize( void ) /***********************/ { #ifdef _OS2 - if( FmtData.type & ( MK_OS2 | MK_WIN_VXD ) ) { + if( FmtData.type & ( MK_OS2 | MK_WIN_NE | MK_WIN_VXD ) ) { FmtRelocSize = sizeof( os2_reloc_item ); return; } @@ -566,13 +566,13 @@ bool SwapOutRelocs( void ) if( (LinkState & LS_FMT_DECIDED) == 0 ) return( false ); - if( FmtData.type & (MK_OS2_FLAT | MK_PE) ) { + if( FmtData.type & (MK_OS2_FLAT | MK_WIN_VXD | MK_PE) ) { for( group = Groups; group != NULL; group = group->next_group ) { if( TraverseOS2RelocList( group, SpillRelocList ) ) { return( true ); } } - } else if( FmtData.type & (MK_OS2_16BIT | MK_QNX) ) { + } else if( FmtData.type & (MK_OS2_NE | MK_WIN_NE | MK_QNX) ) { for( group = Groups; group != NULL; group = group->next_group ) { if( SpillRelocList( group->g.grp_relocs ) ) { return( true ); diff --git a/bld/wl/c/toc.c b/bld/wl/c/toc.c index 08361fe7fc..0825d4e585 100644 --- a/bld/wl/c/toc.c +++ b/bld/wl/c/toc.c @@ -2,6 +2,7 @@ * * Open Watcom Project * +* Copyright (c) 2023 The Open Watcom Contributors. All Rights Reserved. * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== @@ -218,7 +219,7 @@ void PrepareToc( void ) WalkHTable( Toc, ConvertTocEntry ); RehashHTable( Toc ); #if 0 - if( (LinkState & LS_HAVE_PPC_CODE) && (FmtData.type & MK_OS2) ) { + if( (LinkState & LS_HAVE_PPC_CODE) && (FmtData.type & (MK_OS2 | MK_WIN_NE)) ) { // Development temporarly on hold offset middle = ( TocSize / 2 ) & ~0x3; WalkHTableCookie( Toc, AdjustGotEntry, &middle ); @@ -320,7 +321,7 @@ void WriteToc( virt_mem buf ) return; WalkHTableCookie( Toc, WriteOutTokElem, &buf ); #if 0 - if( (LinkState & LS_HAVE_PPC_CODE) && (FmtData.type & MK_OS2) ) { + if( (LinkState & LS_HAVE_PPC_CODE) && (FmtData.type & (MK_OS2 | MK_WIN_NE)) ) { // Development temporarly on hold offset res[GOT_RESERVED_SIZE / sizeof( offset )] = { 0 }; enum { zero = GOT_RESERVED_NEG_SIZE / sizeof( offset ) }; diff --git a/bld/wl/c/wlink.c b/bld/wl/c/wlink.c index a9ec542722..ae69cfeee3 100644 --- a/bld/wl/c/wlink.c +++ b/bld/wl/c/wlink.c @@ -105,9 +105,9 @@ static void PreAddrCalcFormatSpec( void ) // format specific routines which need to be called before address calculation { #ifdef _OS2 - if( FmtData.type & (MK_PE | MK_WIN_VXD | MK_OS2) ) { + if( FmtData.type & (MK_PE | MK_WIN_VXD | MK_OS2 | MK_WIN_NE) ) { #if 0 - if( (FmtData.type & MK_OS2) && (LinkState & LS_HAVE_PPC_CODE) ) { + if( (FmtData.type & (MK_OS2 | MK_WIN_NE)) && (LinkState & LS_HAVE_PPC_CODE) ) { // Development temporarly on hold: // ChkOS2ElfData(); } else { @@ -138,9 +138,9 @@ static void PostAddrCalcFormatSpec( void ) // format specific routines which need to be called after address calculation { #ifdef _OS2 - if( FmtData.type & (MK_PE | MK_WIN_VXD | MK_OS2) ) { + if( FmtData.type & (MK_PE | MK_WIN_VXD | MK_OS2 | MK_WIN_NE) ) { #if 0 - if( (FmtData.type & MK_OS2) && (LinkState & LS_HAVE_PPC_CODE) ) { + if( (FmtData.type & (MK_OS2 | MK_WIN_NE)) && (LinkState & LS_HAVE_PPC_CODE) ) { // Development temporarly on hold: //PrepareOS2Elf(); } else { diff --git a/bld/wl/h/formats.h b/bld/wl/h/formats.h index 9c1821dc38..6a0e900984 100644 --- a/bld/wl/h/formats.h +++ b/bld/wl/h/formats.h @@ -2,7 +2,7 @@ * * Open Watcom Project * -* Copyright (c) 2002-2020 The Open Watcom Contributors. All Rights Reserved. +* Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved. * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== @@ -35,7 +35,7 @@ typedef enum { // there is a corresp. table in MSG.C MK_OS2_NE = CONSTU32( 0x00000001 ), MK_OS2_LE = CONSTU32( 0x00000002 ), MK_OS2_LX = CONSTU32( 0x00000004 ), - MK_WINDOWS = CONSTU32( 0x00000008 ), + MK_WIN_NE = CONSTU32( 0x00000008 ), MK_PE = CONSTU32( 0x00000010 ), MK_DOS_EXE = CONSTU32( 0x00000020 ), MK_COM = CONSTU32( 0x00000040 ), @@ -58,28 +58,24 @@ typedef enum { // there is a corresp. table in MSG.C } exe_format; #define MK_DOS (MK_OVERLAYS | MK_DOS_EXE | MK_COM) -#define MK_ONLY_OS2_16 MK_OS2_NE -#define MK_OS2_FLAT (MK_OS2_LE | MK_OS2_LX | MK_WIN_VXD) -#define MK_ONLY_OS2 (MK_ONLY_OS2_16 | MK_OS2_LE | MK_OS2_LX) -#define MK_OS2_16BIT (MK_ONLY_OS2_16 | MK_WINDOWS) -/* MK_WIN_VXD is not included into MK_OS2 */ -#define MK_OS2 (MK_OS2_16BIT | MK_OS2_LE | MK_OS2_LX) +#define MK_OS2_FLAT (MK_OS2_LE | MK_OS2_LX) +#define MK_OS2 (MK_OS2_NE | MK_OS2_FLAT) #define MK_PHAR_LAP (MK_PHAR_SIMPLE | MK_PHAR_FLAT | MK_PHAR_REX | MK_PHAR_MULTISEG) #define MK_QNX (MK_QNX_16 | MK_QNX_FLAT) #define MK_RDOS (MK_RDOS_16 | MK_RDOS_32) #define MK_64BIT (MK_PE | MK_ELF) -#define MK_32BIT (MK_PHAR_LAP | MK_NOVELL | MK_QNX | MK_OS2_LE | MK_OS2_LX | MK_PE | MK_ELF | MK_WIN_VXD | MK_ZDOS | MK_RAW | MK_RDOS_32) -#define MK_16BIT (MK_DOS | MK_OS2_16BIT | MK_DOS16M | MK_RDOS_16) +#define MK_32BIT (MK_PHAR_LAP | MK_NOVELL | MK_QNX | MK_OS2_FLAT | MK_PE | MK_ELF | MK_WIN_VXD | MK_ZDOS | MK_RAW | MK_RDOS_32) +#define MK_16BIT (MK_DOS | MK_OS2_NE | MK_WIN_NE | MK_DOS16M | MK_RDOS_16) /* MK_OS2_LE, MK_OS2_LX, MK_WIN_VXD and MK_PE are not treated as FLAT internally */ #define MK_FLAT_OFFS (MK_PHAR_SIMPLE | MK_PHAR_FLAT | MK_PHAR_REX | MK_ZDOS | MK_RAW) #define MK_ALLOW_64 (MK_64BIT) #define MK_ALLOW_32 (MK_32BIT) -#define MK_ALLOW_16 (MK_16BIT | MK_PHAR_FLAT | MK_OS2 | MK_QNX | MK_PE | MK_WIN_VXD | MK_RAW) +#define MK_ALLOW_16 (MK_16BIT | MK_PHAR_FLAT | MK_OS2_FLAT | MK_QNX | MK_PE | MK_WIN_VXD | MK_RAW) #define MK_ID_SPLIT (MK_NOVELL) #define MK_REAL_MODE (MK_DOS) #define MK_PROT_MODE (~MK_REAL_MODE) -#define MK_SEGMENTED (MK_16BIT | MK_OS2 | MK_PHAR_MULTISEG | MK_RDOS_16) -#define MK_IMPORTS (MK_NOVELL | MK_OS2 | MK_PE | MK_ELF) +#define MK_SEGMENTED (MK_16BIT | MK_OS2_FLAT | MK_PHAR_MULTISEG) +#define MK_IMPORTS (MK_NOVELL | MK_OS2 | MK_WIN_NE | MK_PE | MK_ELF) #define MK_SPLIT_DATA (MK_ELF | MK_PE) #define MK_LINEARIZE (MK_ELF | MK_PE) #define MK_END_PAD (MK_DOS)