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
47286920
Commit
47286920
authored
Jul 01, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve a bit the assembly generated for import thunks.
parent
623e272c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
16 deletions
+11
-16
relay.c
dlls/ntdll/relay.c
+5
-6
import.c
tools/winebuild/import.c
+6
-10
No files found.
dlls/ntdll/relay.c
View file @
47286920
...
@@ -722,12 +722,11 @@ static BOOL is_register_entry_point( const BYTE *addr )
...
@@ -722,12 +722,11 @@ static BOOL is_register_entry_point( const BYTE *addr )
}
}
else
/* check for import thunk */
else
/* check for import thunk */
{
{
if
(
addr
[
0
]
!=
0x50
)
return
FALSE
;
/* pushl %%eax */
if
(
addr
[
0
]
!=
0x50
)
return
FALSE
;
/* pushl %eax */
if
(
addr
[
1
]
!=
0x9c
)
return
FALSE
;
/* pushfl */
if
(
addr
[
1
]
!=
0xe8
||
addr
[
2
]
||
addr
[
3
]
||
addr
[
4
]
||
addr
[
5
])
return
FALSE
;
/* call .+0 */
if
(
addr
[
2
]
!=
0xe8
||
addr
[
3
]
||
addr
[
4
]
||
addr
[
5
]
||
addr
[
6
])
return
FALSE
;
/* call .+0 */
if
(
addr
[
6
]
!=
0x58
)
return
FALSE
;
/* popl %eax */
if
(
addr
[
7
]
!=
0x58
)
return
FALSE
;
/* popl %%eax */
if
(
addr
[
7
]
!=
0x8b
||
addr
[
8
]
!=
0x80
)
return
FALSE
;
/* movl offset(%eax),%eax */
if
(
addr
[
8
]
!=
0x05
)
return
FALSE
;
/* addl offset,%%eax */
ptr
=
addr
+
6
+
*
(
const
int
*
)(
addr
+
9
);
ptr
=
addr
+
7
+
*
(
const
int
*
)(
addr
+
9
);
}
}
return
(
*
(
const
char
*
const
*
)
ptr
==
(
char
*
)
__wine_call_from_32_regs
);
return
(
*
(
const
char
*
const
*
)
ptr
==
(
char
*
)
__wine_call_from_32_regs
);
}
}
...
...
tools/winebuild/import.c
View file @
47286920
...
@@ -688,7 +688,7 @@ int resolve_imports( DLLSPEC *spec )
...
@@ -688,7 +688,7 @@ int resolve_imports( DLLSPEC *spec )
/* output a single import thunk */
/* output a single import thunk */
static
void
output_import_thunk
(
FILE
*
outfile
,
const
char
*
name
,
const
char
*
table
,
int
pos
)
static
void
output_import_thunk
(
FILE
*
outfile
,
const
char
*
name
,
const
char
*
table
,
int
pos
)
{
{
fprintf
(
outfile
,
"
\"\\
t.align %d
\\
n
\"\n
"
,
get_alignment
(
8
)
);
fprintf
(
outfile
,
"
\"\\
t.align %d
\\
n
\"\n
"
,
get_alignment
(
4
)
);
fprintf
(
outfile
,
"
\"\\
t%s
\\
n
\"\n
"
,
func_declaration
(
name
)
);
fprintf
(
outfile
,
"
\"\\
t%s
\\
n
\"\n
"
,
func_declaration
(
name
)
);
fprintf
(
outfile
,
"
\"\\
t.globl %s
\\
n
\"\n
"
,
asm_name
(
name
)
);
fprintf
(
outfile
,
"
\"\\
t.globl %s
\\
n
\"\n
"
,
asm_name
(
name
)
);
fprintf
(
outfile
,
"
\"
%s:
\\
n
\"\n
"
,
asm_name
(
name
)
);
fprintf
(
outfile
,
"
\"
%s:
\\
n
\"\n
"
,
asm_name
(
name
)
);
...
@@ -708,17 +708,14 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
...
@@ -708,17 +708,14 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
{
{
/* special case: need to preserve all registers */
/* special case: need to preserve all registers */
fprintf
(
outfile
,
"
\"\\
tpushl %%eax
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tpushl %%eax
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tpushfl
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tcall .L__wine_spec_%s
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"\\
tcall .L__wine_spec_%s
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"
.L__wine_spec_%s:
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"
.L__wine_spec_%s:
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"\\
tpopl %%eax
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tpopl %%eax
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
taddl $%d+%s-.L__wine_spec_%s,%%eax
\\
n
\"\n
"
,
pos
,
asm_name
(
table
),
name
);
if
(
!
strcmp
(
name
,
"__wine_call_from_16_regs"
))
if
(
!
strcmp
(
name
,
"__wine_call_from_16_regs"
))
fprintf
(
outfile
,
"
\"\\
t.byte 0x2e
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
t.byte 0x2e
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tmovl
0(%%eax),%%eax
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tmovl
%s+%d-.L__wine_spec_%s(%%eax),%%eax
\\
n
\"\n
"
,
fprintf
(
outfile
,
"
\"\\
txchgl 4(%%esp),%%eax
\\
n
\"\n
"
);
asm_name
(
table
),
pos
,
name
);
fprintf
(
outfile
,
"
\"\\
t
popfl
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
t
xchgl %%eax,(%%esp)
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tret
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tret
\\
n
\"\n
"
);
}
}
else
else
...
@@ -726,11 +723,10 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
...
@@ -726,11 +723,10 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
fprintf
(
outfile
,
"
\"\\
tcall .L__wine_spec_%s
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"\\
tcall .L__wine_spec_%s
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"
.L__wine_spec_%s:
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"
.L__wine_spec_%s:
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"\\
tpopl %%eax
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tpopl %%eax
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
taddl $%d+%s-.L__wine_spec_%s,%%eax
\\
n
\"\n
"
,
pos
,
asm_name
(
table
),
name
);
if
(
strstr
(
name
,
"__wine_call_from_16"
))
if
(
strstr
(
name
,
"__wine_call_from_16"
))
fprintf
(
outfile
,
"
\"\\
t.byte 0x2e
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
t.byte 0x2e
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tjmp *0(%%eax)
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
tjmp *%s+%d-.L__wine_spec_%s(%%eax)
\\
n
\"\n
"
,
asm_name
(
table
),
pos
,
name
);
}
}
}
}
break
;
break
;
...
...
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