This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Porting libsanitizer to aarch64


On Wed, May 22, 2013 at 11:25:18AM +0400, Konstantin Serebryany wrote:
> > > Then arises a runtime problem: aarch64's frame grows upward which is
> > > not supported: how long would it take to develop this support if at
> > > all possible?
> >
> > Better do what all other targets that want to support -fstack-protector*
> > or -fsanitize=address, use frame grows downward if flag_stack_protector
> > || flag_asan.  You wouldn't have -fstack-protector* support otherwise
> > either.
> >
> 
> I would second that.
> Supporting upward-growing stack will introduce quite a bit of disruption in
> the run-time library and
> in both compiler modules (GCC and LLVM).

Frame grows upward isn't necessarily stack grows upward, the former is just
mostly compiler internal decision in which direction to allocate automatic
variables and later on spill slots, the latter is an ABI matter and AFAIK
only PA and stormy16 goes against all other architectures on that.
That said, at least for stack protector frame grows downward is a must,
because you don't want array overflows to clobber spill slots, thus spill
slots must go below arrays which are laid out earlier.

Changing frame grows upward into frame grows downward shouldn't be that
hard, see e.g. rs6000 port, where
#define FRAME_GROWS_DOWNWARD (flag_stack_protect != 0 || flag_asan != 0)
and grep the port where it uses FRAME_GROWS_DOWNWARD.
Basically you need to tweak initial elimination offset computation for it,
and that might be it, or perhaps one or two extra spots.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]