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
9d0ba368
Commit
9d0ba368
authored
Mar 01, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Make relay entry points hot-patchable.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
26bbbb7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
spec32.c
tools/winebuild/spec32.c
+19
-5
No files found.
tools/winebuild/spec32.c
View file @
9d0ba368
...
...
@@ -218,13 +218,14 @@ static void output_relay_debug( DLLSPEC *spec )
if
(
!
needs_relay
(
odp
))
continue
;
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
".L__wine_spec_relay_entry_point_%d:
\n
"
,
i
);
output_cfi
(
".cfi_startproc"
);
switch
(
target_cpu
)
{
case
CPU_x86
:
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
"
\t
.long 0x90909090,0x90909090
\n
"
);
output
(
".L__wine_spec_relay_entry_point_%d:
\n
"
,
i
);
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
.byte 0x8b,0xff,0x55,0x8b,0xec,0x5d
\n
"
);
/* hotpatch prolog */
if
(
odp
->
flags
&
(
FLAG_THISCALL
|
FLAG_FASTCALL
))
/* add the register arguments */
{
output
(
"
\t
popl %%eax
\n
"
);
...
...
@@ -251,6 +252,7 @@ static void output_relay_debug( DLLSPEC *spec )
output
(
"
\t
ret $%u
\n
"
,
get_args_size
(
odp
));
else
output
(
"
\t
ret
\n
"
);
output_cfi
(
".cfi_endproc"
);
break
;
case
CPU_ARM
:
...
...
@@ -263,6 +265,9 @@ static void output_relay_debug( DLLSPEC *spec )
has_float
=
is_float_arg
(
odp
,
j
);
val
=
(
odp
->
u
.
func
.
args_str_offset
<<
16
)
|
(
i
-
spec
->
base
);
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
".L__wine_spec_relay_entry_point_%d:
\n
"
,
i
);
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
push {r0-r3}
\n
"
);
output
(
"
\t
mov r2, SP
\n
"
);
if
(
has_float
)
output
(
"
\t
vpush {s0-s15}
\n
"
);
...
...
@@ -279,10 +284,14 @@ static void output_relay_debug( DLLSPEC *spec )
output
(
"
\t
add SP, #%u
\n
"
,
24
+
(
has_float
?
64
:
0
)
);
output
(
"
\t
bx IP
\n
"
);
output
(
"2:
\t
.long .L__wine_spec_relay_descr-1b
\n
"
);
output_cfi
(
".cfi_endproc"
);
break
;
}
case
CPU_ARM64
:
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
".L__wine_spec_relay_entry_point_%d:
\n
"
,
i
);
output_cfi
(
".cfi_startproc"
);
switch
(
odp
->
u
.
func
.
nb_args
)
{
default:
...
...
@@ -314,9 +323,14 @@ static void output_relay_debug( DLLSPEC *spec )
if
(
odp
->
u
.
func
.
nb_args
)
output
(
"
\t
add SP, SP, #%u
\n
"
,
8
*
((
min
(
odp
->
u
.
func
.
nb_args
,
8
)
+
1
)
&
~
1
)
);
output
(
"
\t
ret
\n
"
);
output_cfi
(
".cfi_endproc"
);
break
;
case
CPU_x86_64
:
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
"
\t
.long 0x90909090,0x90909090
\n
"
);
output
(
".L__wine_spec_relay_entry_point_%d:
\n
"
,
i
);
output_cfi
(
".cfi_startproc"
);
switch
(
odp
->
u
.
func
.
nb_args
)
{
default:
output
(
"
\t
movq %%%s,32(%%rsp)
\n
"
,
is_float_arg
(
odp
,
3
)
?
"xmm3"
:
"r9"
);
...
...
@@ -333,12 +347,12 @@ static void output_relay_debug( DLLSPEC *spec )
output
(
"
\t
leaq .L__wine_spec_relay_descr(%%rip),%%rcx
\n
"
);
output
(
"
\t
callq *8(%%rcx)
\n
"
);
output
(
"
\t
ret
\n
"
);
output_cfi
(
".cfi_endproc"
);
break
;
default:
assert
(
0
);
}
output_cfi
(
".cfi_endproc"
);
}
}
...
...
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