Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
4e4acd5f
Commit
4e4acd5f
authored
11 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
winebuild: Generate position-independent code for ARM.
parent
f4985e42
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/winebuild/import.c
+28
-31
28 additions, 31 deletions
tools/winebuild/import.c
tools/winebuild/spec32.c
+22
-20
22 additions, 20 deletions
tools/winebuild/spec32.c
with
50 additions
and
51 deletions
tools/winebuild/import.c
+
28
−
31
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!,
{r
4
-r
10
,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!,
{r
4
-r
10
,FP,LR}
\n
"
);
output
(
"
\t
ldmfd SP!, {r0-r3}
\n
"
);
output
(
"
\t
mov PC,IP
\n
"
);
output
(
"
\t
push
{r
0
-r
3
,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
{r
0
-r
3
,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
);
...
...
This diff is collapsed.
Click to expand it.
tools/winebuild/spec32.c
+
22
−
20
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
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment