File stack-protector-aarch64.patch of Package gcc48.2996

2013-11-13  Christophe Lyon  <christophe.lyon@linaro.org>

	* config/aarch64/aarch64.h (FRAME_GROWS_DOWNWARD): Define to 1.
	* config/aarch64/aarch64.c (aarch64_initial_elimination_offset):
	Update offset calculations.

Index: gcc-4.8.2-r206703/gcc/config/aarch64/aarch64.c
===================================================================
--- gcc-4.8.2-r206703.orig/gcc/config/aarch64/aarch64.c
+++ gcc-4.8.2-r206703/gcc/config/aarch64/aarch64.c
@@ -3919,7 +3919,7 @@ aarch64_initial_elimination_offset (unsi
 	 return offset - crtl->outgoing_args_size;
 
        if (from == FRAME_POINTER_REGNUM)
-	 return cfun->machine->frame.saved_regs_size;
+	 return cfun->machine->frame.saved_regs_size + get_frame_size ();
      }
 
    if (to == STACK_POINTER_REGNUM)
@@ -3928,6 +3928,7 @@ aarch64_initial_elimination_offset (unsi
          {
            HOST_WIDE_INT elim = crtl->outgoing_args_size
                               + cfun->machine->frame.saved_regs_size
+                              + get_frame_size ()
                               - cfun->machine->frame.fp_lr_offset;
            elim = AARCH64_ROUND_UP (elim, STACK_BOUNDARY / BITS_PER_UNIT);
            return elim;
Index: gcc-4.8.2-r206703/gcc/config/aarch64/aarch64.h
===================================================================
--- gcc-4.8.2-r206703.orig/gcc/config/aarch64/aarch64.h
+++ gcc-4.8.2-r206703/gcc/config/aarch64/aarch64.h
@@ -475,7 +475,7 @@ extern enum aarch64_processor aarch64_tu
 /* Stack layout; function entry, exit and calling.  */
 #define STACK_GROWS_DOWNWARD	1
 
-#define FRAME_GROWS_DOWNWARD	0
+#define FRAME_GROWS_DOWNWARD	1
 
 #define STARTING_FRAME_OFFSET	0