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
29060f3d
Commit
29060f3d
authored
Nov 29, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add a helper function to output a thunk data pointer.
parent
d406de18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
29 deletions
+38
-29
build.h
tools/winebuild/build.h
+2
-0
import.c
tools/winebuild/import.c
+4
-29
utils.c
tools/winebuild/utils.c
+32
-0
No files found.
tools/winebuild/build.h
View file @
29060f3d
...
...
@@ -252,6 +252,8 @@ extern void output_cfi( const char *format, ... )
__attribute__
((
__format__
(
__printf__
,
1
,
2
)));
extern
void
output_rva
(
const
char
*
format
,
...
)
__attribute__
((
__format__
(
__printf__
,
1
,
2
)));
extern
void
output_thunk_rva
(
int
ordinal
,
const
char
*
format
,
...
)
__attribute__
((
__format__
(
__printf__
,
2
,
3
)));
extern
void
spawn
(
struct
strarray
array
);
extern
struct
strarray
find_tool
(
const
char
*
name
,
const
char
*
const
*
names
);
extern
struct
strarray
find_link_tool
(
void
);
...
...
tools/winebuild/import.c
View file @
29060f3d
...
...
@@ -869,16 +869,8 @@ static void output_immediate_imports(void)
if
(
func
->
name
)
output
(
"__imp_%s:
\n
"
,
asm_name
(
func
->
name
));
else
if
(
func
->
export_name
)
output
(
"__imp_%s:
\n
"
,
asm_name
(
func
->
export_name
));
}
if
(
func
->
name
)
output
(
"
\t
%s .L__wine_spec_import_data_%s_%s-.L__wine_spec_rva_base
\n
"
,
get_asm_ptr_keyword
(),
import
->
c_name
,
func
->
name
);
else
{
if
(
get_ptr_size
()
==
8
)
output
(
"
\t
.quad 0x800000000000%04x
\n
"
,
func
->
ordinal
);
else
output
(
"
\t
.long 0x8000%04x
\n
"
,
func
->
ordinal
);
}
output_thunk_rva
(
func
->
name
?
-
1
:
func
->
ordinal
,
".L__wine_spec_import_data_%s_%s"
,
import
->
c_name
,
func
->
name
);
}
output
(
"
\t
%s 0
\n
"
,
get_asm_ptr_keyword
()
);
}
...
...
@@ -1861,31 +1853,14 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
}
output
(
"
\n\t
.section
\"
.idata$4
\"\n
"
);
if
(
by_name
)
{
output_rva
(
".L__wine_import_name"
);
if
(
get_ptr_size
()
==
8
)
output
(
"
\t
.long 0
\n
"
);
}
else
{
if
(
get_ptr_size
()
==
4
)
output
(
"
\t
.long 0x8000%04x
\n
"
,
odp
->
ordinal
);
else
output
(
"
\t
.quad 0x800000000000%04x
\n
"
,
odp
->
ordinal
);
}
output_thunk_rva
(
by_name
?
-
1
:
odp
->
ordinal
,
".L__wine_import_name"
);
output
(
"
\n\t
.section
\"
.idata$5
\"\n
"
);
output
(
"%s
\n
"
,
asm_globl
(
imp_name
)
);
if
(
is_delay
)
output
(
"
\t
%s .L__wine_delay_import
\n
"
,
get_asm_ptr_keyword
()
);
else
if
(
by_name
)
{
output_rva
(
".L__wine_import_name"
);
if
(
get_ptr_size
()
==
8
)
output
(
"
\t
.long 0
\n
"
);
}
else
{
if
(
get_ptr_size
()
==
4
)
output
(
"
\t
.long 0x8000%04x
\n
"
,
odp
->
ordinal
);
else
output
(
"
\t
.quad 0x800000000000%04x
\n
"
,
odp
->
ordinal
);
}
output_thunk_rva
(
by_name
?
-
1
:
odp
->
ordinal
,
".L__wine_import_name"
);
if
(
by_name
)
{
...
...
tools/winebuild/utils.c
View file @
29060f3d
...
...
@@ -984,6 +984,38 @@ void output_rva( const char *format, ... )
va_end
(
valist
);
}
/* output an RVA pointer or ordinal for a function thunk */
void
output_thunk_rva
(
int
ordinal
,
const
char
*
format
,
...
)
{
if
(
ordinal
==
-
1
)
{
va_list
valist
;
va_start
(
valist
,
format
);
switch
(
target
.
platform
)
{
case
PLATFORM_MINGW
:
case
PLATFORM_WINDOWS
:
output
(
"
\t
.rva "
);
vfprintf
(
output_file
,
format
,
valist
);
fputc
(
'\n'
,
output_file
);
if
(
get_ptr_size
()
==
8
)
output
(
"
\t
.long 0
\n
"
);
break
;
default:
output
(
"
\t
%s "
,
get_asm_ptr_keyword
()
);
vfprintf
(
output_file
,
format
,
valist
);
output
(
" - .L__wine_spec_rva_base
\n
"
);
break
;
}
va_end
(
valist
);
}
else
{
if
(
get_ptr_size
()
==
4
)
output
(
"
\t
.long 0x8000%04x
\n
"
,
ordinal
);
else
output
(
"
\t
.quad 0x800000000000%04x
\n
"
,
ordinal
);
}
}
/* output the GNU note for non-exec stack */
void
output_gnu_stack_note
(
void
)
{
...
...
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