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

Andrew Turner andrew at fubar.geek.nz
Sat Apr 27 08:35:21 PDT 2013


On Sat, 27 Apr 2013 22:30:05 +0800
Jiong Wang <jiwang at tilera.com> wrote:

> 于 2013/4/27 17:51, Andrew Turner 写道:
> > On Mon, 22 Apr 2013 11:22:59 +0100
> > Renato Golin <renato.golin at linaro.org> wrote:
> >
> >> Hi Andrew,
> >>
> >> Sorry for the delay. I had a read on the code around it and it
> >> seems that with your patch, the stack will always grow if there is
> >> a call and not a frame pointer. I'm not sure how this correlates
> >> with functions without stack setup, line __aeabi_read_tp, but it
> >> might bloat the stack for many other unrelated functions.
> >>
> >> However, I can see from the comments that adjusting the stack
> >> should be done on any function call, and I don't know that part of
> >> the code well enough, so if no one else has any objections, I'm ok
> >> with your patch.
> > Is anyone else able to comment on this patch?
> Hi Andrew,
> 
> I found the invoke of "__aeabi_read_tp" is actually expanded from
> pseudo instructions "TPsoft", and merely "bl __aeabi_read_tp"
> generated. it's not a indirect call by PLT stub, so I think it should
> not trigger dynamic linker.

Except, at least on FreeBSD, __aeabi_read_tp is implemented in libc.
Because of this llvm will generate an indirect call and enters the
dynamic linker. I have observed this, it is how I found this issue.

Andrew




More information about the llvm-commits mailing list