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
ebb9c5e2
Commit
ebb9c5e2
authored
Mar 22, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Use a global flag to determine when to generate the get_pc thunk.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77a13f69
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
build.h
tools/winebuild/build.h
+1
-1
import.c
tools/winebuild/import.c
+3
-10
spec16.c
tools/winebuild/spec16.c
+3
-0
spec32.c
tools/winebuild/spec32.c
+6
-1
No files found.
tools/winebuild/build.h
View file @
ebb9c5e2
...
...
@@ -284,7 +284,6 @@ extern void read_undef_symbols( DLLSPEC *spec, char **argv );
extern
void
resolve_imports
(
DLLSPEC
*
spec
);
extern
int
is_undefined
(
const
char
*
name
);
extern
int
has_imports
(
void
);
extern
int
has_relays
(
DLLSPEC
*
spec
);
extern
void
output_get_pc_thunk
(
void
);
extern
void
output_module
(
DLLSPEC
*
spec
);
extern
void
output_stubs
(
DLLSPEC
*
spec
);
...
...
@@ -363,5 +362,6 @@ extern struct strarray nm_command;
extern
char
*
cpu_option
;
extern
char
*
arch_option
;
extern
int
thumb_mode
;
extern
int
needs_get_pc_thunk
;
#endif
/* __WINE_BUILD_H */
tools/winebuild/import.c
View file @
ebb9c5e2
...
...
@@ -587,8 +587,7 @@ int is_undefined( const char *name )
/* output the get_pc thunk if needed */
void
output_get_pc_thunk
(
void
)
{
if
(
target_cpu
!=
CPU_x86
)
return
;
if
(
!
UsePIC
)
return
;
assert
(
target_cpu
==
CPU_x86
);
output
(
"
\n\t
.text
\n
"
);
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
output
(
"
\t
%s
\n
"
,
func_declaration
(
"__wine_spec_get_pc_thunk_eax"
)
);
...
...
@@ -619,6 +618,7 @@ static void output_import_thunk( const char *name, const char *table, int pos )
{
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
output
(
"1:
\t
jmp *%s+%d-1b(%%eax)
\n
"
,
table
,
pos
);
needs_get_pc_thunk
=
1
;
}
break
;
case
CPU_x86_64
:
...
...
@@ -1189,6 +1189,7 @@ void output_stubs( DLLSPEC *spec )
{
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
output
(
"1:"
);
needs_get_pc_thunk
=
1
;
if
(
exp_name
)
{
output
(
"
\t
leal .L%s_string-1b(%%eax),%%ecx
\n
"
,
name
);
...
...
@@ -1291,14 +1292,6 @@ void output_imports( DLLSPEC *spec )
output_immediate_import_thunks
();
output_delayed_import_thunks
(
spec
);
output_external_link_imports
(
spec
);
if
(
!
list_empty
(
&
dll_imports
)
||
!
list_empty
(
&
dll_delayed
)
||
ext_link_imports
.
count
||
has_stubs
(
spec
)
||
has_relays
(
spec
))
{
output_get_pc_thunk
();
}
}
/* output an import library for a Win32 module and additional object files */
...
...
tools/winebuild/spec16.c
View file @
ebb9c5e2
...
...
@@ -356,6 +356,7 @@ static void output_call16_function( ORDDEF *odp )
{
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
output
(
"1:
\t
movl wine_ldt_copy_ptr-1b(%%eax),%%esi
\n
"
);
needs_get_pc_thunk
=
1
;
}
else
output
(
"
\t
movl $%s,%%esi
\n
"
,
asm_name
(
"wine_ldt_copy"
)
);
...
...
@@ -814,6 +815,7 @@ void output_spec16_file( DLLSPEC *spec16 )
resolve_imports
(
spec16
);
add_16bit_exports
(
spec32
,
spec16
);
needs_get_pc_thunk
=
0
;
output_standard_file_header
();
output_module
(
spec32
);
output_module16
(
spec16
);
...
...
@@ -821,6 +823,7 @@ void output_spec16_file( DLLSPEC *spec16 )
output_exports
(
spec32
);
output_imports
(
spec16
);
if
(
is_undefined
(
"__wine_call_from_16"
))
output_asm_relays16
();
if
(
needs_get_pc_thunk
)
output_get_pc_thunk
();
if
(
spec16
->
main_module
)
{
output
(
"
\n\t
%s
\n
"
,
get_asm_string_section
()
);
...
...
tools/winebuild/spec32.c
View file @
ebb9c5e2
...
...
@@ -46,6 +46,8 @@
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
int
needs_get_pc_thunk
=
0
;
/* check if entry point needs a relay thunk */
static
inline
int
needs_relay
(
const
ORDDEF
*
odp
)
{
...
...
@@ -78,7 +80,7 @@ static int is_float_arg( const ORDDEF *odp, int arg )
}
/* check if dll will output relay thunks */
int
has_relays
(
DLLSPEC
*
spec
)
static
int
has_relays
(
DLLSPEC
*
spec
)
{
int
i
;
...
...
@@ -189,6 +191,7 @@ static void output_relay_debug( DLLSPEC *spec )
{
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_get_pc_thunk_eax"
)
);
output
(
"1:
\t
leal .L__wine_spec_relay_descr-1b(%%eax),%%eax
\n
"
);
needs_get_pc_thunk
=
1
;
}
else
output
(
"
\t
movl $.L__wine_spec_relay_descr,%%eax
\n
"
);
output
(
"
\t
pushl %%eax
\n
"
);
...
...
@@ -616,6 +619,7 @@ void output_module( DLLSPEC *spec )
*/
void
BuildSpec32File
(
DLLSPEC
*
spec
)
{
needs_get_pc_thunk
=
0
;
resolve_imports
(
spec
);
output_standard_file_header
();
output_module
(
spec
);
...
...
@@ -623,6 +627,7 @@ void BuildSpec32File( DLLSPEC *spec )
output_exports
(
spec
);
output_imports
(
spec
);
if
(
is_undefined
(
"__wine_call_from_regs"
))
output_asm_relays
();
if
(
needs_get_pc_thunk
)
output_get_pc_thunk
();
output_resources
(
spec
);
output_gnu_stack_note
();
}
...
...
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