This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Add support of "hotfix" -feature for x64


On Sat, Jul 3, 2010 at 2:05 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2010/7/2 Richard Henderson <rth@redhat.com>:
>> On 06/30/2010 04:58 AM, Kai Tietz wrote:
>>> Hello,
>>>
>>> this patch adds the hot-patchabel Win32 feature used by Wine also for x64
>>> targets. Additionally it adds the missing feature part of adding prefix
>>> before function as hot-patchable area, as defined by win32 ABI.
>>
>> I like most of this patch. ?There are a few quirks...
>>
>> + ? ? ?while (filler_count > 0)
>> + ? ? ? ?{
>> + ? ? ? ? fprintf (asm_out_file, ASM_LONG " 0x%x", filler_cc);
>> + ? ? ? ? filler_count -= 4;
>> + ? ? ? ? while ((filler_count & 0xf) != 0)
>> + ? ? ? ? ? {
>> + ? ? ? ? ? ? fprintf (asm_out_file, ", 0x%x", filler_cc);
>> + ? ? ? ? ? ? filler_count -= 4;
>> + ? ? ? ? ? }
>> + ? ? ? ? fprintf (asm_out_file, "\n");
>> + ? ? ? }
>>
>> The double loop overcomplicates things. ?I think you're better off
>> with just a plain for-loop.
>>
>> + ? ? ? /* leaq [%rsp + 0], %rsp ?*/
>> + ? ? ? asm_fprintf (asm_out_file, ASM_BYTE "0x48, 0x8d, 0xa4, 0x24, 0x00, 0x00, 0x00, 0x00\n");
>>
>> Needs line wrap.
>>
>> ? ? ? ? Wine uses this to enable Windows apps to hook the Win32 API
>> ? ? ? ? functions provided by Wine. ?*/
>> - ? ? ?insn = emit_insn (gen_vswapmov (gen_rtx_REG (SImode, DI_REG),
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? gen_rtx_REG (SImode, DI_REG)));
>> ? ? ? push = emit_insn (gen_push (hard_frame_pointer_rtx));
>>
>> The preceeding comment needs adjusting to match the new code. ?Just
>> mentioning that the nop-move is emitted elsewhere should be enough.
>>
>>
>>
>> r~
>>
>
> Here is the patch with suggested corrections.
> Tested for i686-pc-linux and x86_64-pc-mingw32 targets. Ok for apply?
>

I have a very hard time to believe this patch was tested on i686-pc-linux
since revision 161876 is bogus for Linux and caused 5000+ run-time
failures in gcc testsuite on Linux/i686.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]