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
7555fd57
Commit
7555fd57
authored
Mar 06, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Add a helper for generating RVA pointers.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ef9bda4c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
21 deletions
+49
-21
build.h
tools/winebuild/build.h
+2
-0
import.c
tools/winebuild/import.c
+3
-6
res32.c
tools/winebuild/res32.c
+4
-2
spec32.c
tools/winebuild/spec32.c
+18
-13
utils.c
tools/winebuild/utils.c
+22
-0
No files found.
tools/winebuild/build.h
View file @
7555fd57
...
...
@@ -248,6 +248,8 @@ extern int output( const char *format, ... )
__attribute__
((
__format__
(
__printf__
,
1
,
2
)));
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
spawn
(
struct
strarray
array
);
extern
struct
strarray
find_tool
(
const
char
*
name
,
const
char
*
const
*
names
);
extern
struct
strarray
get_as_command
(
void
);
...
...
tools/winebuild/import.c
View file @
7555fd57
...
...
@@ -722,14 +722,11 @@ static void output_immediate_imports(void)
j
=
0
;
LIST_FOR_EACH_ENTRY
(
import
,
&
dll_imports
,
struct
import
,
entry
)
{
output
(
"
\t
.long .L__wine_spec_import_data_names+%d-.L__wine_spec_rva_base
\n
"
,
/* OriginalFirstThunk */
j
*
get_ptr_size
()
);
output_rva
(
".L__wine_spec_import_data_names + %d"
,
j
*
get_ptr_size
()
);
/* OriginalFirstThunk */
output
(
"
\t
.long 0
\n
"
);
/* TimeDateStamp */
output
(
"
\t
.long 0
\n
"
);
/* ForwarderChain */
output
(
"
\t
.long .L__wine_spec_import_name_%s-.L__wine_spec_rva_base
\n
"
,
/* Name */
import
->
c_name
);
output
(
"
\t
.long .L__wine_spec_import_data_ptrs+%d-.L__wine_spec_rva_base
\n
"
,
/* FirstThunk */
j
*
get_ptr_size
()
);
output_rva
(
".L__wine_spec_import_name_%s"
,
import
->
c_name
);
/* Name */
output_rva
(
".L__wine_spec_import_data_ptrs + %d"
,
j
*
get_ptr_size
()
);
/* FirstThunk */
j
+=
import
->
nb_imports
+
1
;
}
output
(
"
\t
.long 0
\n
"
);
/* OriginalFirstThunk */
...
...
tools/winebuild/res32.c
View file @
7555fd57
...
...
@@ -476,8 +476,10 @@ void output_resources( DLLSPEC *spec )
/* dump the resource data entries */
for
(
i
=
0
,
res
=
spec
->
resources
;
i
<
spec
->
nb_resources
;
i
++
,
res
++
)
output
(
"
\t
.long .L__wine_spec_res_%d-.L__wine_spec_rva_base,%u,0,0
\n
"
,
i
,
res
->
data_size
);
{
output_rva
(
".L__wine_spec_res_%d"
,
i
);
output
(
"
\t
.long %u,0,0
\n
"
,
res
->
data_size
);
}
/* dump the name strings */
...
...
tools/winebuild/spec32.c
View file @
7555fd57
...
...
@@ -378,15 +378,15 @@ void output_exports( DLLSPEC *spec )
output
(
"
\t
.long 0
\n
"
);
/* Characteristics */
output
(
"
\t
.long 0
\n
"
);
/* TimeDateStamp */
output
(
"
\t
.long 0
\n
"
);
/* MajorVersion/MinorVersion */
output
(
"
\t
.long .L__wine_spec_exp_names-.L__wine_spec_rva_base
\n
"
);
/* Name */
output
_rva
(
".L__wine_spec_exp_names"
);
/* Name */
output
(
"
\t
.long %u
\n
"
,
spec
->
base
);
/* Base */
output
(
"
\t
.long %u
\n
"
,
nr_exports
);
/* NumberOfFunctions */
output
(
"
\t
.long %u
\n
"
,
spec
->
nb_names
);
/* NumberOfNames */
output
(
"
\t
.long .L__wine_spec_exports_funcs-.L__wine_spec_rva_base
\n
"
);
/* AddressOfFunctions */
output
_rva
(
".L__wine_spec_exports_funcs "
);
/* AddressOfFunctions */
if
(
spec
->
nb_names
)
{
output
(
"
\t
.long .L__wine_spec_exp_name_ptrs-.L__wine_spec_rva_base
\n
"
);
/* AddressOfNames */
output
(
"
\t
.long .L__wine_spec_exp_ordinals-.L__wine_spec_rva_base
\n
"
);
/* AddressOfNameOrdinals */
output
_rva
(
".L__wine_spec_exp_name_ptrs
"
);
/* AddressOfNames */
output
_rva
(
".L__wine_spec_exp_ordinals
"
);
/* AddressOfNameOrdinals */
}
else
{
...
...
@@ -440,7 +440,7 @@ void output_exports( DLLSPEC *spec )
output
(
"
\n
.L__wine_spec_exp_name_ptrs:
\n
"
);
for
(
i
=
0
;
i
<
spec
->
nb_names
;
i
++
)
{
output
(
"
\t
.long .L__wine_spec_exp_names+%u-.L__wine_spec_rva_base
\n
"
,
namepos
);
output
_rva
(
".L__wine_spec_exp_names + %u
"
,
namepos
);
namepos
+=
strlen
(
spec
->
names
[
i
]
->
name
)
+
1
;
}
...
...
@@ -636,8 +636,7 @@ void output_module( DLLSPEC *spec )
output
(
"
\t
.short %u,%u
\n
"
,
/* Major/MinorSubsystemVersion */
spec
->
subsystem_major
,
spec
->
subsystem_minor
);
output
(
"
\t
.long 0
\n
"
);
/* Win32VersionValue */
output
(
"
\t
.long %s-.L__wine_spec_rva_base
\n
"
,
/* SizeOfImage */
asm_name
(
"_end"
)
);
output_rva
(
"%s"
,
asm_name
(
"_end"
)
);
/* SizeOfImage */
output
(
"
\t
.long %u
\n
"
,
page_size
);
/* SizeOfHeaders */
output
(
"
\t
.long 0
\n
"
);
/* CheckSum */
output
(
"
\t
.short 0x%04x
\n
"
,
/* Subsystem */
...
...
@@ -652,20 +651,26 @@ void output_module( DLLSPEC *spec )
output
(
"
\t
.long 16
\n
"
);
/* NumberOfRvaAndSizes */
if
(
spec
->
base
<=
spec
->
limit
)
/* DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT] */
output
(
"
\t
.long .L__wine_spec_exports-.L__wine_spec_rva_base,"
".L__wine_spec_exports_end-.L__wine_spec_exports
\n
"
);
{
output_rva
(
".L__wine_spec_exports"
);
output
(
"
\t
.long .L__wine_spec_exports_end-.L__wine_spec_exports
\n
"
);
}
else
output
(
"
\t
.long 0,0
\n
"
);
if
(
has_imports
())
/* DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] */
output
(
"
\t
.long .L__wine_spec_imports-.L__wine_spec_rva_base,"
".L__wine_spec_imports_end-.L__wine_spec_imports
\n
"
);
{
output_rva
(
".L__wine_spec_imports"
);
output
(
"
\t
.long .L__wine_spec_imports_end-.L__wine_spec_imports
\n
"
);
}
else
output
(
"
\t
.long 0,0
\n
"
);
if
(
spec
->
nb_resources
)
/* DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE] */
output
(
"
\t
.long .L__wine_spec_resources-.L__wine_spec_rva_base,"
".L__wine_spec_resources_end-.L__wine_spec_resources
\n
"
);
{
output_rva
(
".L__wine_spec_resources"
);
output
(
"
\t
.L__wine_spec_resources_end-.L__wine_spec_resources
\n
"
);
}
else
output
(
"
\t
.long 0,0
\n
"
);
...
...
tools/winebuild/utils.c
View file @
7555fd57
...
...
@@ -1107,6 +1107,28 @@ void output_cfi( const char *format, ... )
va_end
(
valist
);
}
/* output an RVA pointer */
void
output_rva
(
const
char
*
format
,
...
)
{
va_list
valist
;
va_start
(
valist
,
format
);
switch
(
target_platform
)
{
case
PLATFORM_WINDOWS
:
output
(
"
\t
.rva "
);
vfprintf
(
output_file
,
format
,
valist
);
fputc
(
'\n'
,
output_file
);
break
;
default:
output
(
"
\t
.long "
);
vfprintf
(
output_file
,
format
,
valist
);
output
(
" - .L__wine_spec_rva_base
\n
"
);
break
;
}
va_end
(
valist
);
}
/* 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