This is the mail archive of the
mailing list for the GCC project.
Re: [patch i386 windows]: Fix PR/52790 also required for workig upcoming cygwin x64 target
- From: Richard Henderson <rth at redhat dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 02 Apr 2013 10:18:51 -0700
- Subject: Re: [patch i386 windows]: Fix PR/52790 also required for workig upcoming cygwin x64 target
- References: <CAEwic4a29_oyZdWL7S97gX+6Q5rYjnNO1BckZJ7S1peNA6wung at mail dot gmail dot com>
On 2013-03-22 02:27, Kai Tietz wrote:
this patch fixes PR/52790 and supports for x64 Windows targets the use
of large and medium code-model.
This feature is required for upcoming new cygwin x64 target, which
uses full 48-bit available address-space of x64 Windows.
The cygwin-target depends on pseudo-relocation-feature, which operates
on instruction relocations. This can lead for x86_64 to issues, due
instructions are in general signed-32bit-pc-relative relocated. So
distances can become too wide for pseudo-relocation.
Due for functions we generate anyway on pe-coff targets jump-stubs, we
just need to make sure that variables are accessed via
reference-pointer-variables. So we add for them in medium model
In large model we using for external (therefore possibly
pseudo-relocated) symbols also indirect-addressing via refptr-stubs.
To avoid same issues as we noticed on cygwin64, I want to change
code-model default to medium also for native-windows x64 target.
2013-03-22 Kai Tietz <firstname.lastname@example.org>
* config/i386/cygming.h (SUB_TARGET_RECORD_STUB): New sub-target macro.
* config/i386/i386-protos.h (i386_pe_record_stub): Add new prototype.
* config/i386/i386.c (legitimize_pe_coff_extern_decl): New static function.
(is_imported_p): New helper-function.
(ix86_option_override_internal): Make MEDIUM_PIC the default code-model
for Windows x64 targets.
(ix86_expand_prologue): Optimize for pe-coff targets.
(ix86_expand_split_stack_prologue): Adjust for pe-coff targets.
(legitimate_pic_address_disp_p): Adjust for x64 pe-coff to support
(get_dllimport_decl): Add new beimport argument.
(construct_plt_address): Don't assert for x64 pe-coff targets.
* config/i386/i386.h (PIC_OFFSET_TABLE_REGNUM): Adjust for x64 pe-coff
(SYMBOL_FLAG_STUBVAR): New macro.
* config/i386/winnt.c (stub_list): New structure.
(stub_head): New local variable.
(i386_pe_record_stub): New function.
(i386_pe_file_end): Emit refptr-stubs.