1 From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001
2 From: Andrew McDonnell <bugs@andrewmcdonnell.net>
3 Date: Fri, 3 Oct 2014 19:09:00 +0930
4 Subject: Add .note.GNU-stack section
6 See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html
7 Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html
9 Re: [Patch, MIPS] Add .note.GNU-stack section
11 From: Steve Ellcey <sellcey at mips dot com>
13 On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote:
16 > On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote:
18 > This works except you did not update the assembly files in
19 > libgcc or glibc. We (Cavium) have the same patch in our tree
20 > for a few released versions.
22 > Mind just checking yours in then Andrew?
27 I talked to Andrew about what files he changed in GCC and created and
28 tested this new patch. Andrew also mentioned changing some assembly
29 files in glibc but I don't see any use of '.section .note.GNU-stack' in
30 any assembly files in glibc (for any platform) so I wasn't planning on
31 creating a glibc to add them to mips glibc assembly language files.
33 OK to check in this patch?
40 2014-09-26 Steve Ellcey <sellcey@mips.com>
42 gcc/config/mips/mips.c | 3 +++
43 libgcc/config/mips/crti.S | 4 ++++
44 libgcc/config/mips/crtn.S | 3 +++
45 libgcc/config/mips/mips16.S | 4 ++++
46 libgcc/config/mips/vr4120-div.S | 4 ++++
47 5 files changed, 18 insertions(+)
49 --- a/gcc/config/mips/mips.c
50 +++ b/gcc/config/mips/mips.c
51 @@ -22627,6 +22627,9 @@ mips_starting_frame_offset (void)
52 #undef TARGET_STARTING_FRAME_OFFSET
53 #define TARGET_STARTING_FRAME_OFFSET mips_starting_frame_offset
55 +#undef TARGET_ASM_FILE_END
56 +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
58 struct gcc_target targetm = TARGET_INITIALIZER;
61 --- a/libgcc/config/mips/crti.S
62 +++ b/libgcc/config/mips/crti.S
63 @@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except
64 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
65 <http://www.gnu.org/licenses/>. */
68 +/* An executable stack is *not* required for these functions. */
69 + .section .note.GNU-stack,"",%progbits
71 /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
72 Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
74 --- a/libgcc/config/mips/crtn.S
75 +++ b/libgcc/config/mips/crtn.S
76 @@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except
77 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
78 <http://www.gnu.org/licenses/>. */
80 +/* An executable stack is *not* required for these functions. */
81 + .section .note.GNU-stack,"",%progbits
83 /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
84 Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
86 --- a/libgcc/config/mips/mips16.S
87 +++ b/libgcc/config/mips/mips16.S
88 @@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI
89 values using the soft-float calling convention, but do the actual
90 operation using the hard floating point instructions. */
92 +/* An executable stack is *not* required for these functions. */
93 + .section .note.GNU-stack,"",%progbits
96 #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64)
98 /* This file contains 32-bit assembly code. */
99 --- a/libgcc/config/mips/vr4120-div.S
100 +++ b/libgcc/config/mips/vr4120-div.S
101 @@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI
102 -mfix-vr4120. div and ddiv do not give the correct result when one
103 of the operands is negative. */
105 +/* An executable stack is *not* required for these functions. */
106 + .section .note.GNU-stack,"",%progbits