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
7c91993e
Commit
7c91993e
authored
Jul 05, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't depend on ELF features for PIC code.
A couple of optimizations.
parent
b7dc53d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
26 deletions
+19
-26
relay.c
tools/winebuild/relay.c
+19
-26
No files found.
tools/winebuild/relay.c
View file @
7c91993e
...
...
@@ -139,21 +139,15 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
fprintf
(
outfile
,
"
\t
pushl %%edx
\n
"
);
/* Save original EFlags register */
fprintf
(
outfile
,
"
\t
pushfl
\n
"
);
if
(
reg_func
)
fprintf
(
outfile
,
"
\t
pushfl
\n
"
);
if
(
UsePIC
)
{
/* Get Global Offset Table into %ecx */
fprintf
(
outfile
,
"
\t
call .L__wine_call_from_16_%s.getgot1
\n
"
,
name
);
fprintf
(
outfile
,
".L__wine_call_from_16_%s.getgot1:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
call .Lcall_from_16_%s.getpc
\n
"
,
name
);
fprintf
(
outfile
,
".Lcall_from_16_%s.getpc:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
popl %%ecx
\n
"
);
fprintf
(
outfile
,
"
\t
addl $_GLOBAL_OFFSET_TABLE_+[.-.L__wine_call_from_16_%s.getgot1], %%ecx
\n
"
,
name
);
}
if
(
UsePIC
)
{
fprintf
(
outfile
,
"
\t
.byte 0x2e
\n\t
movl %s(%%ecx), %%edx
\n
"
,
asm_name
(
"CallTo16_DataSelector@GOT"
)
);
fprintf
(
outfile
,
"
\t
.byte 0x2e
\n\t
movl (%%edx), %%edx
\n
"
);
fprintf
(
outfile
,
"
\t
.byte 0x2e
\n\t
movl %s-.Lcall_from_16_%s.getpc(%%ecx),%%edx
\n
"
,
asm_name
(
"CallTo16_DataSelector"
),
name
);
}
else
fprintf
(
outfile
,
"
\t
.byte 0x2e
\n\t
movl %s,%%edx
\n
"
,
asm_name
(
"CallTo16_DataSelector"
)
);
...
...
@@ -163,31 +157,29 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
fprintf
(
outfile
,
"%s
\t
movw %%dx, %%es
\n
"
,
data16_prefix
()
);
if
(
UsePIC
)
{
fprintf
(
outfile
,
"
\t
movl %s(%%ecx), %%edx
\n
"
,
asm_name
(
"CallTo16_TebSelector@GOT"
)
);
fprintf
(
outfile
,
"
\t
movw (%%edx), %%fs
\n
"
);
}
fprintf
(
outfile
,
"
\t
movw %s-.Lcall_from_16_%s.getpc(%%ecx), %%fs
\n
"
,
asm_name
(
"CallTo16_TebSelector"
),
name
);
else
fprintf
(
outfile
,
"
\t
movw %s, %%fs
\n
"
,
asm_name
(
"CallTo16_TebSelector"
)
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
mov (%d),%%gs
\n
"
,
STRUCTOFFSET
(
TEB
,
gs_sel
)
);
/* Get address of wine_ldt_copy array into %ecx */
if
(
UsePIC
)
fprintf
(
outfile
,
"
\t
movl %s(%%ecx), %%ecx
\n
"
,
asm_name
(
"wine_ldt_copy@GOT"
)
);
else
fprintf
(
outfile
,
"
\t
movl $%s, %%ecx
\n
"
,
asm_name
(
"wine_ldt_copy"
)
);
/* Translate STACK16FRAME base to flat offset in %edx */
fprintf
(
outfile
,
"
\t
movw %%ss, %%dx
\n
"
);
fprintf
(
outfile
,
"
\t
andl $0xfff8, %%edx
\n
"
);
fprintf
(
outfile
,
"
\t
shrl $1, %%edx
\n
"
);
fprintf
(
outfile
,
"
\t
movl (%%ecx,%%edx), %%edx
\n
"
);
if
(
UsePIC
)
{
fprintf
(
outfile
,
"
\t
addl wine_ldt_copy_ptr-.Lcall_from_16_%s.getpc(%%ecx),%%edx
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
movl (%%edx), %%edx
\n
"
);
}
else
fprintf
(
outfile
,
"
\t
movl %s(%%edx), %%edx
\n
"
,
asm_name
(
"wine_ldt_copy"
)
);
fprintf
(
outfile
,
"
\t
movzwl %%sp, %%ebp
\n
"
);
fprintf
(
outfile
,
"
\t
leal
(%%ebp,%%edx), %%edx
\n
"
);
fprintf
(
outfile
,
"
\t
leal
%d(%%ebp,%%edx), %%edx
\n
"
,
reg_func
?
0
:
-
4
);
/* Get saved flags into %ecx */
fprintf
(
outfile
,
"
\t
popl %%ecx
\n
"
);
if
(
reg_func
)
fprintf
(
outfile
,
"
\t
popl %%ecx
\n
"
);
/* Get the 32-bit stack pointer from the TEB and complete STACK16FRAME */
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
movl (%d), %%ebp
\n
"
,
STACKOFFSET
);
...
...
@@ -908,13 +900,13 @@ static void BuildPendingEventCheck( FILE *outfile )
/* Start cleanup. Restore fs register. */
fprintf
(
outfile
,
".globl %s
\n
"
,
asm_name
(
"DPMI_PendingEventCheck_Cleanup"
)
);
fprintf
(
outfile
,
"
\t
.globl %s
\n
"
,
asm_name
(
"DPMI_PendingEventCheck_Cleanup"
)
);
fprintf
(
outfile
,
"%s:
\n
"
,
asm_name
(
"DPMI_PendingEventCheck_Cleanup"
)
);
fprintf
(
outfile
,
"
\t
popw %%fs
\n
"
);
/* Return from function. */
fprintf
(
outfile
,
".globl %s
\n
"
,
asm_name
(
"DPMI_PendingEventCheck_Return"
)
);
fprintf
(
outfile
,
"
\t
.globl %s
\n
"
,
asm_name
(
"DPMI_PendingEventCheck_Return"
)
);
fprintf
(
outfile
,
"%s:
\n
"
,
asm_name
(
"DPMI_PendingEventCheck_Return"
)
);
fprintf
(
outfile
,
"
\t
iret
\n
"
);
...
...
@@ -985,6 +977,7 @@ void BuildRelays16( FILE *outfile )
fprintf
(
outfile
,
"%s:
\t
.long 0
\n
"
,
asm_name
(
"CallTo16_DataSelector"
)
);
fprintf
(
outfile
,
"
\t
.globl %s
\n
"
,
asm_name
(
"CallTo16_TebSelector"
)
);
fprintf
(
outfile
,
"%s:
\t
.long 0
\n
"
,
asm_name
(
"CallTo16_TebSelector"
)
);
if
(
UsePIC
)
fprintf
(
outfile
,
"wine_ldt_copy_ptr:
\t
.long %s
\n
"
,
asm_name
(
"wine_ldt_copy"
)
);
}
/*******************************************************************
...
...
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