]> git.ipfire.org Git - thirdparty/gcc.git/commit
Extract ix86 dllimport implementation to mingw
authorEvgeny Karpov <Evgeny.Karpov@microsoft.com>
Mon, 24 Jun 2024 12:38:40 +0000 (12:38 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Tue, 25 Jun 2024 06:38:38 +0000 (06:38 +0000)
commit63512c72df09b43d56ac7680cdfd57a66d40c636
tree26d7e4e7f8fff1c432f168b84c525344d112890d
parent104d06c028c6304edcde736bdc5fffd6aaed94e6
Extract ix86 dllimport implementation to mingw

This patch extracts the ix86 implementation for expanding a SYMBOL
into its corresponding dllimport, far-address, or refptr symbol.  It
will be reused in the aarch64-w64-mingw32 target.  The implementation
is copied as is from i386/i386.cc with minor changes to follow to the
code style.

Also this patch replaces the original DLL import/export implementation
in ix86 with mingw.

2024-06-08  Evgeny Karpov <Evgeny.Karpov@microsoft.com>

gcc/ChangeLog:
* config.gcc: Add winnt-dll.o, which contains the DLL
import/export implementation.
* config/i386/cygming.h (SUB_TARGET_RECORD_STUB): Remove the
old implementation. Rename the required function to MinGW.
Use MinGW implementation for COFF and nothing otherwise.
(GOT_ALIAS_SET): Likewise.
* config/i386/i386-expand.cc (ix86_expand_move): Likewise.
* config/i386/i386-expand.h (ix86_GOT_alias_set): Likewise.
(legitimize_pe_coff_symbol): Likewise.
* config/i386/i386-protos.h (i386_pe_record_stub): Likewise.
* config/i386/i386.cc (is_imported_p): Likewise.
(legitimate_pic_address_disp_p): Likewise.
(ix86_GOT_alias_set): Likewise.
(legitimize_pic_address): Likewise.
(legitimize_tls_address): Likewise.
(struct dllimport_hasher): Likewise.
(GTY): Likewise.
(get_dllimport_decl): Likewise.
(legitimize_pe_coff_extern_decl): Likewise.
(legitimize_dllimport_symbol): Likewise.
(legitimize_pe_coff_symbol): Likewise.
(ix86_legitimize_address): Likewise.
* config/i386/i386.h (GOT_ALIAS_SET): Likewise.
* config/mingw/winnt.cc (i386_pe_record_stub): Likewise.
(mingw_pe_record_stub): Likewise.
* config/mingw/winnt.h (mingw_pe_record_stub): Likewise.
* config/mingw/t-cygming: Add the winnt-dll.o compilation.
* config/mingw/winnt-dll.cc: New file.
* config/mingw/winnt-dll.h: New file.
12 files changed:
gcc/config.gcc
gcc/config/i386/cygming.h
gcc/config/i386/i386-expand.cc
gcc/config/i386/i386-expand.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.cc
gcc/config/i386/i386.h
gcc/config/mingw/t-cygming
gcc/config/mingw/winnt-dll.cc [new file with mode: 0644]
gcc/config/mingw/winnt-dll.h [new file with mode: 0644]
gcc/config/mingw/winnt.cc
gcc/config/mingw/winnt.h