[llvm-commits] Bug in "call __chkstak" on 64 bit OS

Rotem, Nadav nadav.rotem at intel.com
Mon Feb 20 06:36:01 PST 2012


Hi Anton, 

I am not sure I understand.  To my understanding, we have the following problem:  The JIT uses SearchForAddressOfSymbol from Windows/DynamicLibrary.inc to find the address of "chkstk". It returns the address of the first occurrence it finds.  "chkstk" may be present in multiple dlls, some of which may be loaded more than i32 bytes away.  The code in X86FrameLowering and X86ISel assumes that "chkstk" is within 2Gig of the Jitted code. IMHO this is a bug.  So, the problem with the proposed patch is that it does not honor the code model and that it issues an indirect jump on win64 when a 'small' code model is used, right ?

Thanks,
Nadav



-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Anton Korobeynikov
Sent: Sunday, February 19, 2012 17:09
To: NAKAMURA Takumi
Cc: llvm-commits at cs.uiuc.edu; Yatsina, Marina
Subject: Re: [llvm-commits] Bug in "call __chkstak" on 64 bit OS

> In usual executable, __chkstk would be resolved as DLL IAT. You would 
> not need to worry.
> In contrast, JIT might resolve __chkstk directly. IMO, you might tweak 
> EE/JIT symbol resolver (and code emitter).
The proper fix is to honor code model. This way special call to chkstk will behave as normal function call.

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University _______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





More information about the llvm-commits mailing list