diff options
author | midipix <writeonce@midipix.org> | 2019-02-20 15:04:59 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-02-21 00:12:31 -0500 |
commit | da3ab8b405378387b7551977f39383e496eb2491 (patch) | |
tree | fc9c922b903780ef04fb22c31dd647b25057b349 /gcc/config | |
parent | 1b1487d3a6c086cb01bf4520229d58314e6a37e2 (diff) | |
download | cbb-gcc-4.6.4-da3ab8b405378387b7551977f39383e496eb2491.tar.bz2 cbb-gcc-4.6.4-da3ab8b405378387b7551977f39383e496eb2491.tar.xz |
midipix targets: symbol reference optimization: use image-relative relocations.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/midipix.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gcc/config/i386/midipix.c b/gcc/config/i386/midipix.c index 0d81e0d25..8d17ad4bf 100644 --- a/gcc/config/i386/midipix.c +++ b/gcc/config/i386/midipix.c @@ -179,7 +179,7 @@ static void midipix_pe_create_got_entry(FILE * stream, const char * name, tree d fputs("\t",stream); assemble_name(stream,name); fputs("\n\t",stream); - fputs(ptrsize,stream); + fputs(".rva",stream); fputs("\t.symstr_",stream); assemble_name(stream,name); fputs("\n\t.linkonce discard\n\n",stream); @@ -576,6 +576,7 @@ bool midipix_asm_assemble_integer(rtx x, unsigned int size, int aligned_p) section * sect; const char * name; const char * ptrsize; + const char * rvapad; extern int flag_constructor_decl; /* filter out c++ constructors */ @@ -610,12 +611,16 @@ bool midipix_asm_assemble_integer(rtx x, unsigned int size, int aligned_p) if (!falt || (visibility != VISIBILITY_DEFAULT)) return default_assemble_integer(x,size,aligned_p); - /* name, ptrsize, sect */ + /* name, ptrsize, rvapad, sect */ name = XSTR(xref,0); - ptrsize = TARGET_64BIT - ? winnt_ptrsize_quad - : winnt_ptrsize_long; + if (TARGET_64BIT) { + ptrsize = winnt_ptrsize_quad; + rvapad = "\t.long 0\n"; + } else { + ptrsize = winnt_ptrsize_long; + rvapad = ""; + }; sect = xoff ? data_section @@ -646,16 +651,17 @@ bool midipix_asm_assemble_integer(rtx x, unsigned int size, int aligned_p) fputs("\n",asm_out_file); /* back reference */ - fputs("\t",asm_out_file); - fputs(ptrsize,asm_out_file); + fputs("\t.rva",asm_out_file); fputs("\t" "1b" "\n",asm_out_file); + fputs(rvapad,asm_out_file); /* sym reference */ - fputs("\t",asm_out_file); - fputs(ptrsize,asm_out_file); + fputs("\t.rva",asm_out_file); fputs("\t" "__imp_",asm_out_file); assemble_name(asm_out_file,name); - fputs("\n\n\n",asm_out_file); + fputs("\n",asm_out_file); + fputs(rvapad,asm_out_file); + fputs("\n",asm_out_file); /* re-establish current section */ midipix_asm_reestablish_section(asm_out_file,sect); |