winebuild: Added --nxcompat option, and mark all modules as NX-compatible by default.
This commit is contained in:
parent
b2972947ca
commit
662897e9d6
|
@ -99,6 +99,7 @@ typedef struct
|
|||
int nb_names; /* number of entry points with names */
|
||||
unsigned int nb_resources; /* number of resources */
|
||||
int characteristics; /* characteristics for the PE header */
|
||||
int dll_characteristics;/* DLL characteristics for the PE header */
|
||||
int subsystem; /* subsystem id */
|
||||
int subsystem_major; /* subsystem version major number */
|
||||
int subsystem_minor; /* subsystem version minor number */
|
||||
|
|
|
@ -260,6 +260,7 @@ static const char usage_str[] =
|
|||
" -L, --library-path=DIR Look for imports libraries in DIR\n"
|
||||
" -M, --main-module=MODULE Set the name of the main module for a Win16 dll\n"
|
||||
" --nm-cmd=NM Command to use to get undefined symbols (default: nm)\n"
|
||||
" --nxcompat=y|n Set the NX compatibility flag (default: yes)\n"
|
||||
" -N, --dll-name=DLLNAME Set the DLL name (default: from input file name)\n"
|
||||
" -o, --output=NAME Set the output file name (default: stdout)\n"
|
||||
" -r, --res=RSRC.RES Load resources from RSRC.RES\n"
|
||||
|
@ -287,6 +288,7 @@ enum long_options_values
|
|||
LONG_OPT_EXTERNAL_SYMS,
|
||||
LONG_OPT_LDCMD,
|
||||
LONG_OPT_NMCMD,
|
||||
LONG_OPT_NXCOMPAT,
|
||||
LONG_OPT_RELAY16,
|
||||
LONG_OPT_RELAY32,
|
||||
LONG_OPT_SAVE_TEMPS,
|
||||
|
@ -306,6 +308,7 @@ static const struct option long_options[] =
|
|||
{ "external-symbols", 0, 0, LONG_OPT_EXTERNAL_SYMS },
|
||||
{ "ld-cmd", 1, 0, LONG_OPT_LDCMD },
|
||||
{ "nm-cmd", 1, 0, LONG_OPT_NMCMD },
|
||||
{ "nxcompat", 1, 0, LONG_OPT_NXCOMPAT },
|
||||
{ "relay16", 0, 0, LONG_OPT_RELAY16 },
|
||||
{ "relay32", 0, 0, LONG_OPT_RELAY32 },
|
||||
{ "save-temps", 0, 0, LONG_OPT_SAVE_TEMPS },
|
||||
|
@ -476,6 +479,10 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
|
|||
case LONG_OPT_NMCMD:
|
||||
nm_command = xstrdup( optarg );
|
||||
break;
|
||||
case LONG_OPT_NXCOMPAT:
|
||||
if (optarg[0] == 'n' || optarg[0] == 'N')
|
||||
spec->dll_characteristics &= ~IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
|
||||
break;
|
||||
case LONG_OPT_RELAY16:
|
||||
set_exec_mode( MODE_RELAY16 );
|
||||
break;
|
||||
|
|
|
@ -426,8 +426,8 @@ void BuildSpec32File( DLLSPEC *spec )
|
|||
output( "\t.long 0\n" ); /* CheckSum */
|
||||
output( "\t%s 0x%04x\n", /* Subsystem */
|
||||
get_asm_short_keyword(), spec->subsystem );
|
||||
output( "\t%s 0\n", /* DllCharacteristics */
|
||||
get_asm_short_keyword() );
|
||||
output( "\t%s 0x%04x\n", /* DllCharacteristics */
|
||||
get_asm_short_keyword(), spec->dll_characteristics );
|
||||
output( "\t%s %u,%u\n", /* SizeOfStackReserve/Commit */
|
||||
get_asm_ptr_keyword(), (spec->stack_size ? spec->stack_size : 1024) * 1024, page_size );
|
||||
output( "\t%s %u,%u\n", /* SizeOfHeapReserve/Commit */
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "windef.h"
|
||||
#include "winnt.h"
|
||||
#include "build.h"
|
||||
|
||||
#define MAX_TMP_FILES 8
|
||||
|
@ -332,6 +334,7 @@ DLLSPEC *alloc_dll_spec(void)
|
|||
spec->nb_names = 0;
|
||||
spec->nb_resources = 0;
|
||||
spec->characteristics = 0;
|
||||
spec->dll_characteristics = IMAGE_DLLCHARACTERISTICS_NX_COMPAT;
|
||||
spec->subsystem = 0;
|
||||
spec->subsystem_major = 4;
|
||||
spec->subsystem_minor = 0;
|
||||
|
|
|
@ -153,6 +153,10 @@ KRNL386.EXE. It shouldn't be needed otherwise.
|
|||
Specify the command to use to get the list of undefined symbols; the
|
||||
default is \fBnm\fR.
|
||||
.TP
|
||||
.BI --nxcompat= yes|no
|
||||
Specify whether the module is compatible with no-exec support. The
|
||||
default is yes.
|
||||
.TP
|
||||
.BI \-o,\ --output= file
|
||||
Set the name of the output file (default is standard output). If the
|
||||
output file name end in \fB.o\fR, the text output is sent to a
|
||||
|
|
Loading…
Reference in New Issue