diff options
Diffstat (limited to 'winsup/cygwin/scripts/mkimport')
-rwxr-xr-x | winsup/cygwin/scripts/mkimport | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/scripts/mkimport b/winsup/cygwin/scripts/mkimport index 9517c4e..5583099 100755 --- a/winsup/cygwin/scripts/mkimport +++ b/winsup/cygwin/scripts/mkimport @@ -24,6 +24,7 @@ my %import = (); my %symfile = (); my $is_x86_64 = ($cpu eq 'x86_64' ? 1 : 0); +my $is_aarch64 = ($cpu eq 'aarch64' ? 1 : 0); # FIXME? Do other (non-32 bit) arches on Windows still use symbol prefixes? my $sym_prefix = ''; @@ -66,6 +67,19 @@ for my $f (keys %text) { $glob_sym: jmp *$imp_sym(%rip) EOF + } elsif ($is_aarch64) { + print $as_fd <<EOF; + .text + .extern $imp_sym + .global $glob_sym +$glob_sym: + # NOTE: Using instructions that are used by MSVC and LLVM. Binutils are + # using adrp/add/ldr-0-offset though. Please, keep it in sync with + # import_address implementation in winsup/cygwin/mm/malloc_wrapper.cc. + adrp x16, $imp_sym + ldr x16, [x16, #:lo12:$imp_sym] + br x16 +EOF } else { print $as_fd <<EOF; .text |