[Patch] Fix stack alignment for calls without frame setup or destroy

Andrew Turner andrew at fubar.geek.nz
Wed Apr 17 19:35:07 PDT 2013


I have been looking into an issue FreeBSD has been having with
clang/llvm on ARM EABI. The problem is some functions can call
__aeabi_read_tp without correctly aligning the stack.

Normally this would not be a problem as __aeabi_read_tp does not depend
on the stack being correctly aligned, however if we are calling it from
a dynamic executable we will enter the dynamic linker. As the
__aeabi_read_tp call does not include the frame setup or destroy
opcodes the llvm can pass through the check if it needs to adjust the
stack without performing it.

The attached patch makes tells the calling function it needs to
adjust it's stack when it contains a call opcode.

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm_iscall.diff
Type: text/x-patch
Size: 714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130418/891f0eda/attachment.bin>


More information about the llvm-commits mailing list