Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a255dd1f
Commit
a255dd1f
authored
Nov 20, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Stop generating syscall entry points.
parent
2dda6a28
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
162 deletions
+0
-162
build.h
tools/winebuild/build.h
+0
-2
import.c
tools/winebuild/import.c
+0
-143
main.c
tools/winebuild/main.c
+0
-15
spec32.c
tools/winebuild/spec32.c
+0
-1
utils.c
tools/winebuild/utils.c
+0
-1
No files found.
tools/winebuild/build.h
View file @
a255dd1f
...
...
@@ -151,7 +151,6 @@ 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) */
...
...
@@ -313,7 +312,6 @@ extern int has_delay_imports(void);
extern
void
output_get_pc_thunk
(
void
);
extern
void
output_module
(
DLLSPEC
*
spec
);
extern
void
output_stubs
(
DLLSPEC
*
spec
);
extern
void
output_syscalls
(
DLLSPEC
*
spec
);
extern
void
output_imports
(
DLLSPEC
*
spec
);
extern
void
output_import_lib
(
DLLSPEC
*
spec
,
struct
strarray
files
);
extern
void
output_static_lib
(
const
char
*
output_name
,
struct
strarray
files
,
int
create
);
...
...
tools/winebuild/import.c
View file @
a255dd1f
...
...
@@ -576,7 +576,6 @@ static void check_undefined_exports( DLLSPEC *spec )
ORDDEF
*
odp
=
&
spec
->
entry_points
[
i
];
if
(
odp
->
type
==
TYPE_STUB
||
odp
->
type
==
TYPE_ABS
||
odp
->
type
==
TYPE_VARIABLE
)
continue
;
if
(
odp
->
flags
&
FLAG_FORWARD
)
continue
;
if
(
odp
->
flags
&
FLAG_SYSCALL
)
continue
;
if
(
find_name
(
odp
->
link_name
,
undef_symbols
))
{
switch
(
odp
->
type
)
...
...
@@ -594,7 +593,6 @@ static void check_undefined_exports( DLLSPEC *spec )
spec
->
src_name
,
odp
->
lineno
,
odp
->
link_name
);
break
;
default:
if
(
!
strcmp
(
odp
->
link_name
,
"__wine_syscall_dispatcher"
))
break
;
error
(
"%s:%d: external symbol '%s' is not a function
\n
"
,
spec
->
src_name
,
odp
->
lineno
,
odp
->
link_name
);
break
;
...
...
@@ -618,7 +616,6 @@ static char *create_undef_symbols_file( DLLSPEC *spec )
ORDDEF
*
odp
=
&
spec
->
entry_points
[
i
];
if
(
odp
->
type
==
TYPE_STUB
||
odp
->
type
==
TYPE_ABS
||
odp
->
type
==
TYPE_VARIABLE
)
continue
;
if
(
odp
->
flags
&
FLAG_FORWARD
)
continue
;
if
(
odp
->
flags
&
FLAG_SYSCALL
)
continue
;
output
(
"
\t
%s %s
\n
"
,
get_asm_ptr_keyword
(),
asm_name
(
get_link_name
(
odp
)));
}
for
(
j
=
0
;
j
<
extra_ld_symbols
.
count
;
j
++
)
...
...
@@ -1384,146 +1381,6 @@ void output_stubs( DLLSPEC *spec )
}
}
static
int
cmp_link_name
(
const
void
*
e1
,
const
void
*
e2
)
{
const
ORDDEF
*
odp1
=
*
(
const
ORDDEF
*
const
*
)
e1
;
const
ORDDEF
*
odp2
=
*
(
const
ORDDEF
*
const
*
)
e2
;
return
strcmp
(
odp1
->
link_name
,
odp2
->
link_name
);
}
/* output the functions for system calls */
void
output_syscalls
(
DLLSPEC
*
spec
)
{
int
i
,
count
;
ORDDEF
**
syscalls
=
NULL
;
if
(
!
spec
->
syscall_table
)
return
;
for
(
i
=
count
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
{
ORDDEF
*
odp
=
&
spec
->
entry_points
[
i
];
if
(
!
(
odp
->
flags
&
FLAG_SYSCALL
))
continue
;
if
(
strcmp
(
odp
->
name
,
odp
->
link_name
))
continue
;
/* ignore syscall aliases */
if
(
!
syscalls
)
syscalls
=
xmalloc
(
(
spec
->
nb_entry_points
-
i
)
*
sizeof
(
*
syscalls
)
);
syscalls
[
count
++
]
=
odp
;
}
if
(
!
count
)
return
;
count
=
sort_func_list
(
syscalls
,
count
,
cmp_link_name
);
output
(
"
\n
/* system calls */
\n\n
"
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
ORDDEF
*
odp
=
syscalls
[
i
];
const
char
*
name
=
get_link_name
(
odp
);
unsigned
int
id
=
(
spec
->
syscall_table
<<
12
)
+
i
;
output_function_header
(
name
,
1
);
switch
(
target
.
cpu
)
{
case
CPU_i386
:
if
(
UsePIC
)
{
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
"
,
id
);
needs_get_pc_thunk
=
1
;
}
else
{
output
(
"
\t
movl $%u,%%eax
\n
"
,
id
);
output
(
"
\t
movl $%s,%%edx
\n
"
,
asm_name
(
"__wine_syscall"
)
);
}
output
(
"
\t
call *%%edx
\n
"
);
output
(
"
\t
ret $%u
\n
"
,
get_args_size
(
odp
));
break
;
case
CPU_x86_64
:
output_seh
(
".seh_proc %s"
,
asm_name
(
name
)
);
output_seh
(
".seh_endprologue"
);
/* Chromium depends on syscall thunks having the same form as on
* Windows. For 64-bit systems the only viable form we can emulate is
* having an int $0x2e fallback. Since actually using an interrupt is
* expensive, and since for some reason Chromium doesn't actually
* 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
"
,
id
);
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 */
output
(
"
\t
.byte 0xc3
\n
"
);
/* ret */
output
(
"
\t
jmp 1f
\n
"
);
output
(
"
\t
.byte 0xc3
\n
"
);
/* ret */
if
(
is_pe
())
{
output
(
"1:
\t
.byte 0xff,0x14,0x25
\n
"
);
/* 1: callq *(0x7ffe1000) */
output
(
"
\t
.long 0x7ffe1000
\n
"
);
}
else
{
output
(
"
\t
nop
\n
"
);
output
(
"1:
\t
callq *%s(%%rip)
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
}
output
(
"
\t
ret
\n
"
);
output_seh
(
".seh_endproc"
);
break
;
case
CPU_ARM
:
output
(
"
\t
push {r0-r3}
\n
"
);
output
(
"
\t
movw ip, #%u
\n
"
,
id
);
output
(
"
\t
mov r3, lr
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_syscall"
)
);
output
(
"
\t
bx lr
\n
"
);
break
;
case
CPU_ARM64
:
case
CPU_ARM64EC
:
output_seh
(
".seh_proc %s"
,
arm64_name
(
name
)
);
output_seh
(
".seh_endprologue"
);
output
(
"
\t
mov x8, #%u
\n
"
,
id
);
output
(
"
\t
mov x9, x30
\n
"
);
output
(
"
\t
ldr x16, 1f
\n
"
);
output
(
"
\t
ldr x16, [x16]
\n
"
);
output
(
"
\t
blr x16
\n
"
);
output
(
"
\t
ret
\n
"
);
output
(
"1:
\t
.quad %s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output_seh
(
".seh_endproc"
);
break
;
}
output_function_size
(
name
);
}
switch
(
target
.
cpu
)
{
case
CPU_i386
:
if
(
UsePIC
)
break
;
output_function_header
(
"__wine_syscall"
,
0
);
output
(
"
\t
jmp *(%s)
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output_function_size
(
"__wine_syscall"
);
break
;
case
CPU_ARM
:
output_function_header
(
"__wine_syscall"
,
0
);
if
(
UsePIC
)
{
output
(
"
\t
ldr r0, 2f
\n
"
);
output
(
"1:
\t
add r0, pc
\n
"
);
}
else
{
output
(
"
\t
movw r0, :lower16:%s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output
(
"
\t
movt r0, :upper16:%s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
}
output
(
"
\t
ldr r0, [r0]
\n
"
);
output
(
"
\t
bx r0
\n
"
);
if
(
UsePIC
)
output
(
"2:
\t
.long %s-1b-%u
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
),
thumb_mode
?
4
:
8
);
output_function_size
(
"__wine_syscall"
);
break
;
default:
break
;
}
}
/* output the import and delayed import tables of a Win32 module */
void
output_imports
(
DLLSPEC
*
spec
)
{
...
...
tools/winebuild/main.c
View file @
a255dd1f
...
...
@@ -158,15 +158,6 @@ 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
*
name
)
{
...
...
@@ -229,7 +220,6 @@ 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
"
...
...
@@ -269,7 +259,6 @@ enum long_options_values
LONG_OPT_SAVE_TEMPS
,
LONG_OPT_STATICLIB
,
LONG_OPT_SUBSYSTEM
,
LONG_OPT_SYSCALL_TABLE
,
LONG_OPT_VERSION
,
LONG_OPT_WITHOUT_DLLTOOL
,
};
...
...
@@ -301,7 +290,6 @@ static const struct long_option long_options[] =
{
"safeseh"
,
0
,
LONG_OPT_SAFE_SEH
},
{
"save-temps"
,
0
,
LONG_OPT_SAVE_TEMPS
},
{
"subsystem"
,
1
,
LONG_OPT_SUBSYSTEM
},
{
"syscall-table"
,
1
,
LONG_OPT_SYSCALL_TABLE
},
{
"version"
,
0
,
LONG_OPT_VERSION
},
{
"without-dlltool"
,
0
,
LONG_OPT_WITHOUT_DLLTOOL
},
/* aliases for short options */
...
...
@@ -532,9 +520,6 @@ static void option_callback( int optc, char *optarg )
case
LONG_OPT_SUBSYSTEM
:
set_subsystem
(
optarg
,
main_spec
);
break
;
case
LONG_OPT_SYSCALL_TABLE
:
set_syscall_table
(
optarg
,
main_spec
);
break
;
case
LONG_OPT_VERSION
:
printf
(
"winebuild version "
PACKAGE_VERSION
"
\n
"
);
exit
(
0
);
...
...
tools/winebuild/spec32.c
View file @
a255dd1f
...
...
@@ -763,7 +763,6 @@ void output_spec32_file( DLLSPEC *spec )
output_stubs
(
spec
);
output_exports
(
spec
);
output_imports
(
spec
);
output_syscalls
(
spec
);
if
(
needs_get_pc_thunk
)
output_get_pc_thunk
();
output_resources
(
spec
);
output_gnu_stack_note
();
...
...
tools/winebuild/utils.c
View file @
a255dd1f
...
...
@@ -628,7 +628,6 @@ DLLSPEC *alloc_dll_spec(void)
spec
->
subsystem
=
IMAGE_SUBSYSTEM_WINDOWS_CUI
;
spec
->
subsystem_major
=
4
;
spec
->
subsystem_minor
=
0
;
spec
->
syscall_table
=
0
;
spec
->
dll_characteristics
=
IMAGE_DLLCHARACTERISTICS_NX_COMPAT
|
IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
;
return
spec
;
}
...
...
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