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
4e4acd5f
Commit
4e4acd5f
authored
Feb 11, 2014
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Generate position-independent code for ARM.
parent
f4985e42
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
51 deletions
+50
-51
import.c
tools/winebuild/import.c
+28
-31
spec32.c
tools/winebuild/spec32.c
+22
-20
No files found.
tools/winebuild/import.c
View file @
4e4acd5f
...
...
@@ -650,9 +650,9 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output
(
"
\t
jmpq *%s+%d(%%rip)
\n
"
,
table
,
pos
);
break
;
case
CPU_ARM
:
output
(
"
\t
ldr IP,
[PC,#0]
\n
"
);
output
(
"
\t
ldr PC,[
IP,#%d]
\n
"
,
pos
);
output
(
"
\t
.long %s
\n
"
,
table
);
output
(
"
\t
ldr IP,
1f
\n
"
);
output
(
"
\t
ldr PC,[
PC,IP]
\n
"
);
output
(
"
1:
\t
.long %s+%u-(1b+4)
\n
"
,
table
,
pos
);
break
;
case
CPU_ARM64
:
output
(
"
\t
adr x9, 1f
\n
"
);
...
...
@@ -967,15 +967,15 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
jmp *%%rax
\n
"
);
break
;
case
CPU_ARM
:
output
(
"
\t
stmfd SP!, {r4-r10
,FP,LR}
\n
"
);
output
(
"
\t
mov
LR,PC
\n
"
);
output
(
"
\t
add LR,LR,#8
\n
"
);
output
(
"
\t
ldr PC,[PC,#-4]
\n
"
);
output
(
"
\t
.long %s
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
output
(
"
\t
mov IP,r0
\n
"
);
output
(
"
\t
ldmfd SP!, {r4-r10
,FP,LR}
\n
"
);
output
(
"
\t
ldmfd SP!, {r0-r3}
\n
"
);
output
(
"
\t
mov PC,IP
\n
"
);
output
(
"
\t
push {r0-r3
,FP,LR}
\n
"
);
output
(
"
\t
mov
r0,IP
\n
"
);
output
(
"
\t
ldr IP,2f
\n
"
);
output
(
"
\t
add IP,PC
\n
"
);
output
(
"
\t
blx IP
\n
"
);
output
(
"
1:
\t
mov IP,r0
\n
"
);
output
(
"
\t
pop {r0-r3
,FP,LR}
\n
"
);
output
(
"
\t
bx IP
\n
"
);
output
(
"
2:
\t
.long %s-1b
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
break
;
case
CPU_ARM64
:
output
(
"
\t
stp x29, x30, [sp,#-16]!
\n
"
);
...
...
@@ -1067,18 +1067,15 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output
(
"
\t
jmp %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
case
CPU_ARM
:
output
(
"
\t
stmfd SP!, {r0-r3}
\n
"
);
output
(
"
\t
mov r0, #%d
\n
"
,
idx
);
output
(
"
\t
mov r1, #16384
\n
"
);
output
(
"
\t
mul r1, r0, r1
\n
"
);
output
(
"
\t
mov r0, r1
\n
"
);
output
(
"
\t
mov r1, #4
\n
"
);
output
(
"
\t
mul r1, r0, r1
\n
"
);
output
(
"
\t
mov r0, r1
\n
"
);
output
(
"
\t
add r0, #%d
\n
"
,
j
);
output
(
"
\t
ldr PC,[PC,#-4]
\n
"
);
output
(
"
\t
.long %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
{
unsigned
int
mask
,
count
=
0
,
val
=
(
idx
<<
16
)
|
j
;
for
(
mask
=
0xff
;
mask
;
mask
<<=
8
)
if
(
val
&
mask
)
output
(
"
\t
%s IP,#%u
\n
"
,
count
++
?
"add"
:
"mov"
,
val
&
mask
);
if
(
!
count
)
output
(
"
\t
mov IP,#0
\n
"
);
output
(
"
\t
b %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
}
case
CPU_ARM64
:
output
(
"
\t
stp x6, x7, [sp,#-80]!
\n
"
);
output
(
"
\t
stp x4, x5, [sp,#48]
\n
"
);
...
...
@@ -1268,19 +1265,19 @@ void output_stubs( DLLSPEC *spec )
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
break
;
case
CPU_ARM
:
output
(
"
\t
ldr r0,[PC,#0]
\n
"
);
output
(
"
\t
mov PC,PC
\n
"
);
output
(
"
\t
.long .L__wine_spec_file_name
\n
"
);
output
(
"
\t
ldr r1,[PC,#0]
\n
"
);
output
(
"
\t
mov PC,PC
\n
"
);
output
(
"
\t
ldr r0,2f
\n
"
);
output
(
"
\t
add r0,PC
\n
"
);
output
(
"
\t
ldr r1,2f+4
\n
"
);
output
(
"1:"
);
if
(
exp_name
)
{
output
(
"
\t
.long .L%s_string
\n
"
,
name
);
output
(
"
\t
add r1,PC
\n
"
);
count
++
;
}
else
output
(
"
\t
.long %d
\n
"
,
odp
->
ordinal
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"2:
\t
.long .L__wine_spec_file_name-1b
\n
"
);
if
(
exp_name
)
output
(
"
\t
.long .L%s_string-2b
\n
"
,
name
);
else
output
(
"
\t
.long %u
\n
"
,
odp
->
ordinal
);
break
;
default:
assert
(
0
);
...
...
tools/winebuild/spec32.c
View file @
4e4acd5f
...
...
@@ -210,32 +210,34 @@ static void output_relay_debug( DLLSPEC *spec )
break
;
case
CPU_ARM
:
switch
(
args
)
{
unsigned
int
mask
,
val
,
count
=
0
;
unsigned
int
stack_size
=
min
(
16
,
(
args
*
4
+
7
)
&
~
7
);
if
(
odp
->
flags
&
FLAG_RET64
)
flags
|=
1
;
val
=
(
flags
<<
24
)
|
(
args
<<
16
)
|
(
i
-
spec
->
base
);
switch
(
stack_size
)
{
default:
output
(
"
\t
push {r0-r3}
\n
"
);
break
;
case
3
:
output
(
"
\t
push {r0-r2}
\n
"
);
break
;
case
2
:
output
(
"
\t
push {r0-r1}
\n
"
);
break
;
case
1
:
output
(
"
\t
push {r0}
\n
"
);
break
;
case
16
:
output
(
"
\t
push {r0-r3}
\n
"
);
break
;
case
8
:
output
(
"
\t
push {r0-r1}
\n
"
);
break
;
case
0
:
break
;
}
output
(
"
\t
push {LR}
\n
"
);
output
(
"
\t
mov r2, SP
\n
"
);
if
(
odp
->
flags
&
FLAG_RET64
)
flags
|=
1
;
output
(
"
\t
mov r1, #%u
\n
"
,
(
flags
<<
24
)
);
if
(
args
)
output
(
"
\t
add r1, #%u
\n
"
,
(
args
<<
16
)
);
if
((
i
-
spec
->
base
)
&
0xf000
)
output
(
"
\t
add r1, #%u
\n
"
,
(
i
-
spec
->
base
)
&
0xf000
);
if
((
i
-
spec
->
base
)
&
0x0f00
)
output
(
"
\t
add r1, #%u
\n
"
,
(
i
-
spec
->
base
)
&
0x0f00
);
if
((
i
-
spec
->
base
)
&
0x00f0
)
output
(
"
\t
add r1, #%u
\n
"
,
(
i
-
spec
->
base
)
&
0x00f0
);
if
((
i
-
spec
->
base
)
&
0x000f
)
output
(
"
\t
add r1, #%u
\n
"
,
(
i
-
spec
->
base
)
&
0x000f
);
output
(
"
\t
ldr r0, [PC, #0]
\n
"
);
output
(
"
\t
mov PC, PC
\n
"
);
output
(
"
\t
.long .L__wine_spec_relay_descr
\n
"
);
output
(
"
\t
ldr r3, [r0, #4]
\n
"
);
output
(
"
\t
blx r3
\n
"
);
output
(
"
\t
pop {r3}
\n
"
);
if
(
args
)
output
(
"
\t
add SP, SP, #%u
\n
"
,
min
(
args
*
4
,
16
)
);
output
(
"
\t
bx r3
\n
"
);
output
(
"
\t
sub SP, #4
\n
"
);
for
(
mask
=
0xff
;
mask
;
mask
<<=
8
)
if
(
val
&
mask
)
output
(
"
\t
%s r1,#%u
\n
"
,
count
++
?
"add"
:
"mov"
,
val
&
mask
);
if
(
!
count
)
output
(
"
\t
mov r1,#0
\n
"
);
output
(
"
\t
ldr r0, 2f
\n
"
);
output
(
"
\t
add r0, PC
\n
"
);
output
(
"
\t
ldr IP, [r0, #4]
\n
"
);
output
(
"1:
\t
blx IP
\n
"
);
output
(
"
\t
ldr IP, [SP, #4]
\n
"
);
output
(
"
\t
add SP, #%u
\n
"
,
stack_size
+
8
);
output
(
"
\t
bx IP
\n
"
);
output
(
"2:
\t
.long .L__wine_spec_relay_descr-1b
\n
"
);
break
;
}
case
CPU_x86_64
:
output
(
"
\t
subq $40,%%rsp
\n
"
);
...
...
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