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
849d08b0
Commit
849d08b0
authored
Aug 14, 2020
by
Martin Storsjo
Committed by
Alexandre Julliard
Aug 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Use the right arm64 page/pageoff relocation syntax for darwin.
Signed-off-by:
Martin Storsjo
<
martin@martin.st
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0beda8a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
18 deletions
+54
-18
build.h
tools/winebuild/build.h
+2
-0
import.c
tools/winebuild/import.c
+18
-16
spec32.c
tools/winebuild/spec32.c
+2
-2
utils.c
tools/winebuild/utils.c
+32
-0
No files found.
tools/winebuild/build.h
View file @
849d08b0
...
...
@@ -291,6 +291,8 @@ extern const char *get_asm_export_section(void);
extern
const
char
*
get_asm_rodata_section
(
void
);
extern
const
char
*
get_asm_rsrc_section
(
void
);
extern
const
char
*
get_asm_string_section
(
void
);
extern
const
char
*
arm64_page
(
const
char
*
sym
);
extern
const
char
*
arm64_pageoff
(
const
char
*
sym
);
extern
void
output_function_size
(
const
char
*
name
);
extern
void
output_gnu_stack_note
(
void
);
...
...
tools/winebuild/import.c
View file @
849d08b0
...
...
@@ -761,8 +761,8 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output
(
"1:
\t
.long %s+%u-(1b+4)
\n
"
,
table
,
pos
);
break
;
case
CPU_ARM64
:
output
(
"
\t
adrp x9, %s
\n
"
,
table
);
output
(
"
\t
add x9, x9, #
:lo12:%s
\n
"
,
table
);
output
(
"
\t
adrp x9, %s
\n
"
,
arm64_page
(
table
)
);
output
(
"
\t
add x9, x9, #
%s
\n
"
,
arm64_pageoff
(
table
)
);
if
(
pos
&
0xf000
)
output
(
"
\t
add x9, x9, #%u
\n
"
,
pos
&
0xf000
);
if
(
pos
&
0x0f00
)
output
(
"
\t
add x9, x9, #%u
\n
"
,
pos
&
0x0f00
);
if
(
pos
&
0x00f0
)
output
(
"
\t
add x9, x9, #%u
\n
"
,
pos
&
0x00f0
);
...
...
@@ -1080,8 +1080,8 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
case
CPU_ARM64
:
output
(
"
\t
stp x29, x30, [sp,#-16]!
\n
"
);
output
(
"
\t
mov x29, sp
\n
"
);
output
(
"
\t
adrp x9, %s
\n
"
,
a
sm_name
(
"__wine_spec_delay_load"
)
);
output
(
"
\t
add x9, x9, #
:lo12:%s
\n
"
,
asm_name
(
"__wine_spec_delay_load"
)
);
output
(
"
\t
adrp x9, %s
\n
"
,
a
rm64_page
(
asm_name
(
"__wine_spec_delay_load"
)
)
);
output
(
"
\t
add x9, x9, #
%s
\n
"
,
arm64_pageoff
(
asm_name
(
"__wine_spec_delay_load"
)
)
);
output
(
"
\t
blr x9
\n
"
);
output
(
"
\t
mov x9, x0
\n
"
);
output
(
"
\t
ldp x29, x30, [sp],#16
\n
"
);
...
...
@@ -1367,17 +1367,19 @@ void output_stubs( DLLSPEC *spec )
else
output
(
"
\t
.long %u
\n
"
,
odp
->
ordinal
);
break
;
case
CPU_ARM64
:
output
(
"
\t
adrp x0,
.L__wine_spec_file_name
\n
"
);
output
(
"
\t
add x0, x0, #
:lo12:.L__wine_spec_file_name
\n
"
);
output
(
"
\t
adrp x0,
%s
\n
"
,
arm64_page
(
".L__wine_spec_file_name"
)
);
output
(
"
\t
add x0, x0, #
%s
\n
"
,
arm64_pageoff
(
".L__wine_spec_file_name"
)
);
if
(
exp_name
)
{
output
(
"
\t
adrp x1, .L%s_string
\n
"
,
name
);
output
(
"
\t
add x1, x1, #:lo12:.L%s_string
\n
"
,
name
);
char
*
sym
=
strmake
(
".L%s_string"
,
name
);
output
(
"
\t
adrp x1, %s
\n
"
,
arm64_page
(
sym
)
);
output
(
"
\t
add x1, x1, #%s
\n
"
,
arm64_pageoff
(
sym
)
);
free
(
sym
);
}
else
output
(
"
\t
mov x1, %u
\n
"
,
odp
->
ordinal
);
output
(
"
\t
adrp x2, %s
\n
"
,
a
sm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"
\t
add x2, x2, #
:lo12:%s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"
\t
adrp x2, %s
\n
"
,
a
rm64_page
(
asm_name
(
"__wine_spec_unimplemented_stub"
)
)
);
output
(
"
\t
add x2, x2, #
%s
\n
"
,
arm64_pageoff
(
asm_name
(
"__wine_spec_unimplemented_stub"
)
)
);
output
(
"
\t
blr x2
\n
"
);
break
;
default:
...
...
@@ -1627,8 +1629,8 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
ldr x20, [x19]
\n
"
);
/* prev frame */
output
(
"
\t
str x20, [sp, #88]
\n
"
);
output
(
"
\t
str x29, [x19]
\n
"
);
/* syscall frame */
output
(
"
\t
adrp x16,
.Lsyscall_args
\n
"
);
output
(
"
\t
add x16, x16, #
:lo12:.Lsyscall_args
\n
"
);
output
(
"
\t
adrp x16,
%s
\n
"
,
arm64_page
(
".Lsyscall_args"
)
);
output
(
"
\t
add x16, x16, #
%s
\n
"
,
arm64_pageoff
(
".Lsyscall_args"
)
);
output
(
"
\t
ldrb w9, [x16, x8]
\n
"
);
output
(
"
\t
subs x9, x9, #64
\n
"
);
output
(
"
\t
bls 2f
\n
"
);
...
...
@@ -1640,8 +1642,8 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
ldr x10, [x11, x9]
\n
"
);
output
(
"
\t
str x10, [sp, x9]
\n
"
);
output
(
"
\t
cbnz x9, 1b
\n
"
);
output
(
"2:
\t
adrp x16,
.Lsyscall_table
\n
"
);
output
(
"
\t
add x16, x16, #
:lo12:.Lsyscall_table
\n
"
);
output
(
"2:
\t
adrp x16,
%s
\n
"
,
arm64_page
(
".Lsyscall_table"
)
);
output
(
"
\t
add x16, x16, #
%s
\n
"
,
arm64_pageoff
(
".Lsyscall_table"
)
);
output
(
"
\t
ldr x16, [x16, x8, lsl 3]
\n
"
);
output
(
"
\t
blr x16
\n
"
);
output
(
"
\t
mov sp, x29
\n
"
);
...
...
@@ -1741,8 +1743,8 @@ void output_syscalls( DLLSPEC *spec )
case
CPU_ARM64
:
output
(
"
\t
stp x29, x30, [sp,#-16]!
\n
"
);
output
(
"
\t
mov x8, #%u
\n
"
,
i
);
output
(
"
\t
adrp x16, %s
\n
"
,
a
sm_name
(
"__wine_syscall_dispatcher"
)
);
output
(
"
\t
ldr x16, [x16, #
:lo12:%s]
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output
(
"
\t
adrp x16, %s
\n
"
,
a
rm64_page
(
asm_name
(
"__wine_syscall_dispatcher"
)
)
);
output
(
"
\t
ldr x16, [x16, #
%s]
\n
"
,
arm64_pageoff
(
asm_name
(
"__wine_syscall_dispatcher"
)
)
);
output
(
"
\t
blr x16
\n
"
);
output
(
"
\t
ldp x29, x30, [sp], #16
\n
"
);
output
(
"
\t
ret
\n
"
);
...
...
tools/winebuild/spec32.c
View file @
849d08b0
...
...
@@ -339,8 +339,8 @@ static void output_relay_debug( DLLSPEC *spec )
output
(
"
\t
stp x8, x9, [SP,#-16]!
\n
"
);
output
(
"
\t
mov w1, #%u
\n
"
,
odp
->
u
.
func
.
args_str_offset
<<
16
);
if
(
i
-
spec
->
base
)
output
(
"
\t
add w1, w1, #%u
\n
"
,
i
-
spec
->
base
);
output
(
"
\t
adrp x0,
.L__wine_spec_relay_descr
\n
"
);
output
(
"
\t
add x0, x0, #
:lo12:.L__wine_spec_relay_descr
\n
"
);
output
(
"
\t
adrp x0,
%s
\n
"
,
arm64_page
(
".L__wine_spec_relay_descr"
)
);
output
(
"
\t
add x0, x0, #
%s
\n
"
,
arm64_pageoff
(
".L__wine_spec_relay_descr"
)
);
output
(
"
\t
ldr x3, [x0, #8]
\n
"
);
output
(
"
\t
blr x3
\n
"
);
output
(
"
\t
add SP, SP, #16
\n
"
);
...
...
tools/winebuild/utils.c
View file @
849d08b0
...
...
@@ -1291,3 +1291,35 @@ const char *get_asm_string_section(void)
default:
return
".section .rodata"
;
}
}
const
char
*
arm64_page
(
const
char
*
sym
)
{
static
char
*
buffer
;
switch
(
target_platform
)
{
case
PLATFORM_APPLE
:
free
(
buffer
);
buffer
=
strmake
(
"%s@PAGE"
,
sym
);
return
buffer
;
default:
return
sym
;
}
}
const
char
*
arm64_pageoff
(
const
char
*
sym
)
{
static
char
*
buffer
;
free
(
buffer
);
switch
(
target_platform
)
{
case
PLATFORM_APPLE
:
buffer
=
strmake
(
"%s@PAGEOFF"
,
sym
);
break
;
default:
buffer
=
strmake
(
":lo12:%s"
,
sym
);
break
;
}
return
buffer
;
}
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