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

Anton Korobeynikov anton at korobeynikov.info
Sun May 5 01:37:24 PDT 2013


The patch at the first glance looks like a gross hammer fix of the
underlying problem. Will it pessimize other code? Or it's a generic
fix for a problem which just manifests so rare?

On Thu, Apr 18, 2013 at 6:35 AM, Andrew Turner <andrew at fubar.geek.nz> wrote:
> 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
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-commits mailing list