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
7c48d8d4
Commit
7c48d8d4
authored
Jan 18, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Support non-PIC mode for ARM targets.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c1a700f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
25 deletions
+56
-25
import.c
tools/winebuild/import.c
+53
-23
spec32.c
tools/winebuild/spec32.c
+3
-2
No files found.
tools/winebuild/import.c
View file @
7c48d8d4
...
...
@@ -755,10 +755,19 @@ 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, 2f
\n
"
);
output
(
"1:
\t
add ip, pc
\n
"
);
output
(
"
\t
ldr pc, [ip]
\n
"
);
output
(
"2:
\t
.long %s+%u-1b-%u
\n
"
,
table
,
pos
,
thumb_mode
?
4
:
8
);
if
(
UsePIC
)
{
output
(
"
\t
ldr ip, 2f
\n
"
);
output
(
"1:
\t
add ip, pc
\n
"
);
output
(
"
\t
ldr pc, [ip]
\n
"
);
output
(
"2:
\t
.long %s+%u-1b-%u
\n
"
,
table
,
pos
,
thumb_mode
?
4
:
8
);
}
else
{
output
(
"
\t
ldr ip, 1f
\n
"
);
output
(
"
\t
ldr pc, [ip]
\n
"
);
output
(
"1:
\t
.long %s+%u
\n
"
,
table
,
pos
);
}
break
;
case
CPU_ARM64
:
output
(
"
\t
adrp x16, %s
\n
"
,
arm64_page
(
table
)
);
...
...
@@ -1348,14 +1357,26 @@ void output_stubs( DLLSPEC *spec )
output
(
"
\t
call %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
break
;
case
CPU_ARM
:
output
(
"
\t
ldr r0,3f
\n
"
);
output
(
"1:
\t
add r0,PC
\n
"
);
output
(
"
\t
ldr r1,3f+4
\n
"
);
if
(
exp_name
)
output
(
"2:
\t
add r1,PC
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"3:
\t
.long .L__wine_spec_file_name-1b-%u
\n
"
,
thumb_mode
?
4
:
8
);
if
(
exp_name
)
output
(
"
\t
.long .L%s_string-2b-%u
\n
"
,
name
,
thumb_mode
?
4
:
8
);
else
output
(
"
\t
.long %u
\n
"
,
odp
->
ordinal
);
if
(
UsePIC
)
{
output
(
"
\t
ldr r0,3f
\n
"
);
output
(
"1:
\t
add r0,PC
\n
"
);
output
(
"
\t
ldr r1,3f+4
\n
"
);
if
(
exp_name
)
output
(
"2:
\t
add r1,PC
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"3:
\t
.long .L__wine_spec_file_name-1b-%u
\n
"
,
thumb_mode
?
4
:
8
);
if
(
exp_name
)
output
(
"
\t
.long .L%s_string-2b-%u
\n
"
,
name
,
thumb_mode
?
4
:
8
);
else
output
(
"
\t
.long %u
\n
"
,
odp
->
ordinal
);
}
else
{
output
(
"
\t
ldr r0,1f
\n
"
);
output
(
"
\t
ldr r1,1f+4
\n
"
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"1:
\t
.long .L__wine_spec_file_name
\n
"
);
if
(
exp_name
)
output
(
"
\t
.long .L%s_string
\n
"
,
name
);
else
output
(
"
\t
.long %u
\n
"
,
odp
->
ordinal
);
}
break
;
case
CPU_ARM64
:
output
(
"
\t
adrp x0, %s
\n
"
,
arm64_page
(
".L__wine_spec_file_name"
)
);
...
...
@@ -1552,7 +1573,7 @@ void output_syscalls( DLLSPEC *spec )
case
CPU_ARM
:
output
(
"
\t
push {r5-r11,lr}
\n
"
);
output
(
"
\t
add r6, sp, #40
\n
"
);
/* stack parameters */
output
(
"
\t
ldr r5,
8f
\n
"
);
output
(
"
\t
ldr r5,
6f+8
\n
"
);
output
(
"
\t
cmp r4, r5
\n
"
);
output
(
"
\t
bcs 5f
\n
"
);
output
(
"
\t
sub sp, sp, #8
\n
"
);
...
...
@@ -1563,8 +1584,8 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
mrs ip, CPSR
\n
"
);
output
(
"
\t
str ip, [sp, #4]
\n
"
);
output
(
"
\t
str sp, [r7]
\n
"
);
/* syscall frame */
output
(
"
\t
ldr r5,
7f
\n
"
);
output
(
"1:
\t
add r5, pc
\n
"
);
output
(
"
\t
ldr r5,
6f+4
\n
"
);
if
(
UsePIC
)
output
(
"1:
\t
add r5, pc
\n
"
);
output
(
"
\t
ldrb r5, [r5, r4]
\n
"
);
/* syscall args */
output
(
"
\t
subs r5, #16
\n
"
);
/* first 4 args are in registers */
output
(
"
\t
ble 3f
\n
"
);
...
...
@@ -1576,7 +1597,7 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
str ip, [sp, r5]
\n
"
);
output
(
"
\t
bgt 2b
\n
"
);
output
(
"3:
\t
ldr r5, 6f
\n
"
);
output
(
"4:
\t
add r5, pc
\n
"
);
if
(
UsePIC
)
output
(
"4:
\t
add r5, pc
\n
"
);
output
(
"
\t
ldr ip, [r5, r4, lsl #2]
\n
"
);
/* syscall table */
output
(
"
\t
blx ip
\n
"
);
output
(
"
\t
mov ip, #0
\n
"
);
...
...
@@ -1584,12 +1605,20 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
sub ip, r6, #40
\n
"
);
output
(
"
\t
mov sp, ip
\n
"
);
output
(
"
\t
pop {r5-r11,pc}
\n
"
);
output
(
"5:
\t
ldr r0,
9f
\n
"
);
output
(
"5:
\t
ldr r0,
6f+12
\n
"
);
output
(
"
\t
pop {r5-r11,pc}
\n
"
);
output
(
"6:
\t
.long .Lsyscall_table-4b-%u
\n
"
,
thumb_mode
?
4
:
8
);
output
(
"7:
\t
.long .Lsyscall_args-1b-%u
\n
"
,
thumb_mode
?
4
:
8
);
output
(
"8:
\t
.long %u
\n
"
,
count
);
output
(
"9:
\t
.long 0x%x
\n
"
,
invalid_param
);
if
(
UsePIC
)
{
output
(
"6:
\t
.long .Lsyscall_table-4b-%u
\n
"
,
thumb_mode
?
4
:
8
);
output
(
"
\t
.long .Lsyscall_args-1b-%u
\n
"
,
thumb_mode
?
4
:
8
);
}
else
{
output
(
"6:
\t
.long .Lsyscall_table
\n
"
);
output
(
"
\t
.long .Lsyscall_args
\n
"
);
}
output
(
"
\t
.long %u
\n
"
,
count
);
output
(
"
\t
.long 0x%x
\n
"
,
invalid_param
);
break
;
case
CPU_ARM64
:
output
(
"
\t
cmp x8, %u
\n
"
,
count
);
...
...
@@ -1731,11 +1760,12 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
push {r4,lr}
\n
"
);
output
(
"
\t
ldr r4, 3f
\n
"
);
output
(
"
\t
ldr ip, 2f
\n
"
);
output
(
"1:
\t
add ip, pc
\n
"
);
if
(
UsePIC
)
output
(
"1:
\t
add ip, pc
\n
"
);
output
(
"
\t
ldr ip, [ip]
\n
"
);
output
(
"
\t
blx ip
\n
"
);
output
(
"
\t
pop {r4,pc}
\n
"
);
output
(
"2:
\t
.long %s-1b-%u
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
),
thumb_mode
?
4
:
8
);
if
(
UsePIC
)
output
(
"2:
\t
.long %s-1b-%u
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
),
thumb_mode
?
4
:
8
);
else
output
(
"2:
\t
.long %s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output
(
"3:
\t
.long %u
\n
"
,
i
);
break
;
case
CPU_ARM64
:
...
...
tools/winebuild/spec32.c
View file @
7c48d8d4
...
...
@@ -319,13 +319,14 @@ static void output_relay_debug( DLLSPEC *spec )
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
(
"1:
\t
add r0, PC
\n
"
);
if
(
UsePIC
)
output
(
"1:
\t
add r0, PC
\n
"
);
output
(
"
\t
ldr IP, [r0, #4]
\n
"
);
output
(
"
\t
blx IP
\n
"
);
output
(
"
\t
ldr IP, [SP, #4]
\n
"
);
output
(
"
\t
add SP, #%u
\n
"
,
24
+
(
has_float
?
64
:
0
)
);
output
(
"
\t
bx IP
\n
"
);
output
(
"2:
\t
.long .L__wine_spec_relay_descr-1b-%u
\n
"
,
thumb_mode
?
4
:
8
);
if
(
UsePIC
)
output
(
"2:
\t
.long .L__wine_spec_relay_descr-1b-%u
\n
"
,
thumb_mode
?
4
:
8
);
else
output
(
"2:
\t
.long .L__wine_spec_relay_descr
\n
"
);
output_cfi
(
".cfi_endproc"
);
break
;
}
...
...
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