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
33236819
Commit
33236819
authored
Mar 08, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Mar 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add support for dynamically generated stub entry points on ARM.
parent
58a50926
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
loader.c
dlls/ntdll/loader.c
+42
-1
No files found.
dlls/ntdll/loader.c
View file @
33236819
...
...
@@ -177,7 +177,7 @@ static inline BOOL call_dll_entry_point( DLLENTRYPROC proc, void *module,
#endif
/* __i386__ */
#if defined(__i386__) || defined(__x86_64__)
#if defined(__i386__) || defined(__x86_64__)
|| defined(__arm__)
/*************************************************************************
* stub_entry_point
*
...
...
@@ -209,6 +209,19 @@ struct stub
BYTE
call
;
/* call stub_entry_point */
DWORD
entry
;
};
#elif defined(__arm__)
struct
stub
{
BYTE
ldr_r0
[
4
];
/* ldr r0, $dll */
BYTE
mov_pc_pc1
[
4
];
/* mov pc,pc */
const
char
*
dll
;
BYTE
ldr_r1
[
4
];
/* ldr r1, $name */
BYTE
mov_pc_pc2
[
4
];
/* mov pc,pc */
const
char
*
name
;
BYTE
mov_r2_lr
[
4
];
/* mov r2, lr */
BYTE
ldr_pc_pc
[
4
];
/* ldr pc, [pc, #-4] */
const
void
*
entry
;
};
#else
struct
stub
{
...
...
@@ -253,6 +266,34 @@ static ULONG_PTR allocate_stub( const char *dll, const char *name )
stub
->
dll
=
dll
;
stub
->
call
=
0xe8
;
/* call stub_entry_point */
stub
->
entry
=
(
BYTE
*
)
stub_entry_point
-
(
BYTE
*
)(
&
stub
->
entry
+
1
);
#elif defined(__arm__)
stub
->
ldr_r0
[
0
]
=
0x00
;
/* ldr r0, $dll */
stub
->
ldr_r0
[
1
]
=
0x00
;
stub
->
ldr_r0
[
2
]
=
0x9f
;
stub
->
ldr_r0
[
3
]
=
0xe5
;
stub
->
mov_pc_pc1
[
0
]
=
0x0f
;
/* mov pc,pc */
stub
->
mov_pc_pc1
[
1
]
=
0xf0
;
stub
->
mov_pc_pc1
[
2
]
=
0xa0
;
stub
->
mov_pc_pc1
[
3
]
=
0xe1
;
stub
->
dll
=
dll
;
stub
->
ldr_r1
[
0
]
=
0x00
;
/* ldr r1, $name */
stub
->
ldr_r1
[
1
]
=
0x10
;
stub
->
ldr_r1
[
2
]
=
0x9f
;
stub
->
ldr_r1
[
3
]
=
0xe5
;
stub
->
mov_pc_pc2
[
0
]
=
0x0f
;
/* mov pc,pc */
stub
->
mov_pc_pc2
[
1
]
=
0xf0
;
stub
->
mov_pc_pc2
[
2
]
=
0xa0
;
stub
->
mov_pc_pc2
[
3
]
=
0xe1
;
stub
->
name
=
name
;
stub
->
mov_r2_lr
[
0
]
=
0x0e
;
/* mov r2, lr */
stub
->
mov_r2_lr
[
1
]
=
0x20
;
stub
->
mov_r2_lr
[
2
]
=
0xa0
;
stub
->
mov_r2_lr
[
3
]
=
0xe1
;
stub
->
ldr_pc_pc
[
0
]
=
0x04
;
/* ldr pc, [pc, #-4] */
stub
->
ldr_pc_pc
[
1
]
=
0xf0
;
stub
->
ldr_pc_pc
[
2
]
=
0x1f
;
stub
->
ldr_pc_pc
[
3
]
=
0xe5
;
stub
->
entry
=
stub_entry_point
;
#else
stub
->
movq_rdi
[
0
]
=
0x48
;
/* movq $dll,%rdi */
stub
->
movq_rdi
[
1
]
=
0xbf
;
...
...
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