Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3513a176
Commit
3513a176
authored
Aug 30, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add an option to set the syscall table id.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
411a8858
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
5 deletions
+29
-5
build.h
tools/winebuild/build.h
+1
-0
import.c
tools/winebuild/import.c
+7
-5
main.c
tools/winebuild/main.c
+15
-0
utils.c
tools/winebuild/utils.c
+1
-0
winebuild.man.in
tools/winebuild/winebuild.man.in
+5
-0
No files found.
tools/winebuild/build.h
View file @
3513a176
...
...
@@ -136,6 +136,7 @@ typedef struct
int
subsystem
;
/* subsystem id */
int
subsystem_major
;
/* subsystem version major number */
int
subsystem_minor
;
/* subsystem version minor number */
int
syscall_table
;
/* syscall table id */
int
unicode_app
;
/* default to unicode entry point */
ORDDEF
*
entry_points
;
/* dll entry points */
ORDDEF
**
names
;
/* array of entry point names (points into entry_points) */
...
...
tools/winebuild/import.c
View file @
3513a176
...
...
@@ -1458,6 +1458,8 @@ void output_syscalls( DLLSPEC *spec )
{
ORDDEF
*
odp
=
syscalls
[
i
];
const
char
*
name
=
get_link_name
(
odp
);
unsigned
int
id
=
(
spec
->
syscall_table
<<
12
)
+
i
;
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
16
)
);
output
(
"
\t
%s
\n
"
,
func_declaration
(
name
)
);
output
(
"%s
\n
"
,
asm_globl
(
name
)
);
...
...
@@ -1469,12 +1471,12 @@ void output_syscalls( DLLSPEC *spec )
{
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
output
(
"1:
\t
movl %s-1b(%%eax),%%edx
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output
(
"
\t
movl $%u,%%eax
\n
"
,
i
);
output
(
"
\t
movl $%u,%%eax
\n
"
,
i
d
);
needs_get_pc_thunk
=
1
;
}
else
{
output
(
"
\t
movl $%u,%%eax
\n
"
,
i
);
output
(
"
\t
movl $%u,%%eax
\n
"
,
i
d
);
output
(
"
\t
movl $%s,%%edx
\n
"
,
asm_name
(
"__wine_syscall"
)
);
}
output
(
"
\t
call *%%edx
\n
"
);
...
...
@@ -1488,7 +1490,7 @@ void output_syscalls( DLLSPEC *spec )
* validate that instruction, we can just put a jmp there instead. */
output
(
"
\t
.byte 0x4c,0x8b,0xd1
\n
"
);
/* movq %rcx,%r10 */
output
(
"
\t
.byte 0xb8
\n
"
);
/* movl $i,%eax */
output
(
"
\t
.long %u
\n
"
,
i
);
output
(
"
\t
.long %u
\n
"
,
i
d
);
output
(
"
\t
.byte 0xf6,0x04,0x25,0x08,0x03,0xfe,0x7f,0x01
\n
"
);
/* testb $1,0x7ffe0308 */
output
(
"
\t
.byte 0x75,0x03
\n
"
);
/* jne 1f */
output
(
"
\t
.byte 0x0f,0x05
\n
"
);
/* syscall */
...
...
@@ -1509,14 +1511,14 @@ void output_syscalls( DLLSPEC *spec )
break
;
case
CPU_ARM
:
output
(
"
\t
push {r0-r3}
\n
"
);
output
(
"
\t
movw ip, #%u
\n
"
,
i
);
output
(
"
\t
movw ip, #%u
\n
"
,
i
d
);
output
(
"
\t
mov r3, lr
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_syscall"
)
);
output
(
"
\t
add sp, #16
\n
"
);
output
(
"
\t
bx lr
\n
"
);
break
;
case
CPU_ARM64
:
output
(
"
\t
mov x8, #%u
\n
"
,
i
);
output
(
"
\t
mov x8, #%u
\n
"
,
i
d
);
output
(
"
\t
mov x9, x30
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_syscall"
));
output
(
"
\t
ret
\n
"
);
...
...
tools/winebuild/main.c
View file @
3513a176
...
...
@@ -202,6 +202,15 @@ static void set_subsystem( const char *subsystem, DLLSPEC *spec )
free
(
str
);
}
/* set the syscall table id */
static
void
set_syscall_table
(
const
char
*
id
,
DLLSPEC
*
spec
)
{
int
val
=
atoi
(
id
);
if
(
val
<
0
||
val
>
3
)
fatal_error
(
"Invalid syscall table id '%s', must be 0-3
\n
"
,
id
);
spec
->
syscall_table
=
val
;
}
/* set the target CPU and platform */
static
void
set_target
(
const
char
*
target
)
{
...
...
@@ -303,6 +312,7 @@ static const char usage_str[] =
" --safeseh Mark object files as SEH compatible
\n
"
" --save-temps Do not delete the generated intermediate files
\n
"
" --subsystem=SUBSYS Set the subsystem (one of native, windows, console, wince)
\n
"
" --syscall-table=ID Set the syscall table id (between 0 and 3)
\n
"
" -u, --undefined=SYMBOL Add an undefined reference to SYMBOL when linking
\n
"
" -v, --verbose Display the programs invoked
\n
"
" --version Print the version and exit
\n
"
...
...
@@ -340,6 +350,7 @@ enum long_options_values
LONG_OPT_SAVE_TEMPS
,
LONG_OPT_STATICLIB
,
LONG_OPT_SUBSYSTEM
,
LONG_OPT_SYSCALL_TABLE
,
LONG_OPT_VERSION
};
...
...
@@ -367,6 +378,7 @@ static const struct option long_options[] =
{
"safeseh"
,
0
,
0
,
LONG_OPT_SAFE_SEH
},
{
"save-temps"
,
0
,
0
,
LONG_OPT_SAVE_TEMPS
},
{
"subsystem"
,
1
,
0
,
LONG_OPT_SUBSYSTEM
},
{
"syscall-table"
,
1
,
0
,
LONG_OPT_SYSCALL_TABLE
},
{
"version"
,
0
,
0
,
LONG_OPT_VERSION
},
/* aliases for short options */
{
"target"
,
1
,
0
,
'b'
},
...
...
@@ -595,6 +607,9 @@ static char **parse_options( int argc, char **argv, DLLSPEC *spec )
case
LONG_OPT_SUBSYSTEM
:
set_subsystem
(
optarg
,
spec
);
break
;
case
LONG_OPT_SYSCALL_TABLE
:
set_syscall_table
(
optarg
,
spec
);
break
;
case
LONG_OPT_VERSION
:
printf
(
"winebuild version "
PACKAGE_VERSION
"
\n
"
);
exit
(
0
);
...
...
tools/winebuild/utils.c
View file @
3513a176
...
...
@@ -911,6 +911,7 @@ DLLSPEC *alloc_dll_spec(void)
spec
->
subsystem
=
0
;
spec
->
subsystem_major
=
4
;
spec
->
subsystem_minor
=
0
;
spec
->
syscall_table
=
0
;
if
(
get_ptr_size
()
>
4
)
spec
->
characteristics
|=
IMAGE_FILE_LARGE_ADDRESS_AWARE
;
else
...
...
tools/winebuild/winebuild.man.in
View file @
3513a176
...
...
@@ -255,6 +255,11 @@ argument array to use Unicode strings. A graphical executable has a
Optionally a major and minor subsystem version can also be specified;
the default subsystem version is 4.0.
.TP
.BI --syscall-table= id
Set the system call table id, between 0 and 3. The default is 0, the
ntdll syscall table. Only useful in modules that define syscall entry
points.
.TP
.BI \-u,\ --undefined= symbol
Add \fIsymbol\fR to the list of undefined symbols when invoking the
linker. This makes it possible to force a specific module of a static
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment