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

NAKAMURA Takumi geek4civic at gmail.com
Mon Feb 20 06:53:33 PST 2012


2012/2/20 Rotem, Nadav <nadav.rotem at intel.com>:
> 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 ?

For your issue, it might be better to tweak symbol resolver to find
chkstk in your dll at first.
(I don't know why DynamicLibrary.inc seeks DLLs at first)

Enhancing memory model for win32 would be needed in future, if we
should support other models, eg. win32 kernel mode...

...Takumi




More information about the llvm-commits mailing list