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
eba56752
Commit
eba56752
authored
Apr 12, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add cfi annotations to the import thunk for i386.
parent
3255b214
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
import.c
tools/winebuild/import.c
+25
-17
No files found.
tools/winebuild/import.c
View file @
eba56752
...
...
@@ -645,9 +645,10 @@ void output_get_pc_thunk(void)
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
"
\t
%s
\n
"
,
func_declaration
(
"__wine_spec_get_pc_thunk_eax"
)
);
output
(
"%s:
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
output
(
"
\t
popl %%eax
\n
"
);
output
(
"
\t
pushl
%%eax
\n
"
);
output
_cfi
(
".cfi_startproc
"
);
output
(
"
\t
movl (%%esp),
%%eax
\n
"
);
output
(
"
\t
ret
\n
"
);
output_cfi
(
".cfi_endproc"
);
output_function_size
(
"__wine_spec_get_pc_thunk_eax"
);
}
...
...
@@ -657,6 +658,7 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output
(
"
\n\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
"
\t
%s
\n
"
,
func_declaration
(
name
)
);
output
(
"%s
\n
"
,
asm_globl
(
name
)
);
output_cfi
(
".cfi_startproc"
);
switch
(
target_cpu
)
{
...
...
@@ -672,9 +674,7 @@ static void output_import_thunk( const char *name, const char *table, int pos )
}
break
;
case
CPU_x86_64
:
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
jmpq *%s+%d(%%rip)
\n
"
,
table
,
pos
);
output_cfi
(
".cfi_endproc"
);
break
;
case
CPU_SPARC
:
if
(
!
UsePIC
)
...
...
@@ -725,6 +725,7 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output
(
"
\t
bctr
\n
"
);
break
;
}
output_cfi
(
".cfi_endproc"
);
output_function_size
(
name
);
}
...
...
@@ -968,19 +969,25 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"%s:
\n
"
,
asm_name
(
delayed_import_loaders
));
output
(
"
\t
%s
\n
"
,
func_declaration
(
"__wine_delay_load_asm"
)
);
output
(
"%s:
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
output_cfi
(
".cfi_startproc"
);
switch
(
target_cpu
)
{
case
CPU_x86
:
output
(
"
\t
pushl %%ecx
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset 4"
);
output
(
"
\t
pushl %%edx
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset 4"
);
output
(
"
\t
pushl %%eax
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset 4"
);
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
output_cfi
(
".cfi_adjust_cfa_offset -4"
);
output
(
"
\t
popl %%edx
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset -4"
);
output
(
"
\t
popl %%ecx
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset -4"
);
output
(
"
\t
jmp *%%eax
\n
"
);
break
;
case
CPU_x86_64
:
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
subq $88,%%rsp
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset 88"
);
output
(
"
\t
movq %%rdx,80(%%rsp)
\n
"
);
...
...
@@ -1000,7 +1007,6 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
addq $88,%%rsp
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset -88"
);
output
(
"
\t
jmp *%%rax
\n
"
);
output_cfi
(
".cfi_endproc"
);
break
;
case
CPU_SPARC
:
output
(
"
\t
save %%sp, -96, %%sp
\n
"
);
...
...
@@ -1068,6 +1074,7 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
bctr
\n
"
);
break
;
}
output_cfi
(
".cfi_endproc"
);
output_function_size
(
"__wine_delay_load_asm"
);
output
(
"
\n
"
);
...
...
@@ -1080,6 +1087,7 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
const
char
*
name
=
odp
->
name
?
odp
->
name
:
odp
->
export_name
;
output
(
".L__wine_delay_imp_%d_%s:
\n
"
,
i
,
name
);
output_cfi
(
".cfi_startproc"
);
switch
(
target_cpu
)
{
case
CPU_x86
:
...
...
@@ -1087,10 +1095,8 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
jmp %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
case
CPU_x86_64
:
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
movq $%d,%%rax
\n
"
,
(
idx
<<
16
)
|
j
);
output
(
"
\t
jmp %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
output_cfi
(
".cfi_endproc"
);
break
;
case
CPU_SPARC
:
output
(
"
\t
set %d, %%g1
\n
"
,
(
idx
<<
16
)
|
j
);
...
...
@@ -1132,6 +1138,7 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
}
break
;
}
output_cfi
(
".cfi_endproc"
);
}
idx
++
;
}
...
...
@@ -1214,6 +1221,7 @@ void output_stubs( DLLSPEC *spec )
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
"
\t
%s
\n
"
,
func_declaration
(
name
)
);
output
(
"%s:
\n
"
,
asm_name
(
name
)
);
output_cfi
(
".cfi_startproc"
);
switch
(
target_cpu
)
{
...
...
@@ -1229,7 +1237,8 @@ void output_stubs( DLLSPEC *spec )
output
(
"
\t
nop
\n
"
);
output
(
"
\t
nop
\n
"
);
output
(
"
\t
subl $4,%%esp
\n
"
);
output
(
"
\t
subl $12,%%esp
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset 12"
);
if
(
UsePIC
)
{
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
...
...
@@ -1237,29 +1246,28 @@ void output_stubs( DLLSPEC *spec )
if
(
exp_name
)
{
output
(
"
\t
leal .L%s_string-1b(%%eax),%%ecx
\n
"
,
name
);
output
(
"
\t
pushl %%ecx
\n
"
);
output
(
"
\t
movl %%ecx,4(%%esp)
\n
"
);
count
++
;
}
else
output
(
"
\t
pushl $%d
\n
"
,
odp
->
ordinal
);
output
(
"
\t
movl $%d,4(%%esp)
\n
"
,
odp
->
ordinal
);
output
(
"
\t
leal .L__wine_spec_file_name-1b(%%eax),%%ecx
\n
"
);
output
(
"
\t
pushl %%ecx
\n
"
);
output
(
"
\t
movl %%ecx,(%%esp)
\n
"
);
}
else
{
if
(
exp_name
)
{
output
(
"
\t
pushl $.L%s_string
\n
"
,
name
);
output
(
"
\t
movl $.L%s_string,4(%%esp)
\n
"
,
name
);
count
++
;
}
else
output
(
"
\t
pushl $%d
\n
"
,
odp
->
ordinal
);
output
(
"
\t
pushl $.L__wine_spec_file_name
\n
"
);
output
(
"
\t
movl $%d,4(%%esp)
\n
"
,
odp
->
ordinal
);
output
(
"
\t
movl $.L__wine_spec_file_name,(%%esp)
\n
"
);
}
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
break
;
case
CPU_x86_64
:
output_cfi
(
".cfi_startproc"
);
output
(
"
\t
subq $8,%%rsp
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset 8"
);
output
(
"
\t
leaq .L__wine_spec_file_name(%%rip),%%rdi
\n
"
);
...
...
@@ -1271,11 +1279,11 @@ void output_stubs( DLLSPEC *spec )
else
output
(
"
\t
movq $%d,%%rsi
\n
"
,
odp
->
ordinal
);
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output_cfi
(
".cfi_endproc"
);
break
;
default:
assert
(
0
);
}
output_cfi
(
".cfi_endproc"
);
output_function_size
(
name
);
}
...
...
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