You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.6 KiB

  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
  5. See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html
  6. Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html
  7. Re: [Patch, MIPS] Add .note.GNU-stack section
  8. From: Steve Ellcey <sellcey at mips dot com>
  9. On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote:
  10. >
  11. >
  12. > On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote:
  13. > This works except you did not update the assembly files in
  14. > libgcc or glibc. We (Cavium) have the same patch in our tree
  15. > for a few released versions.
  16. > Mind just checking yours in then Andrew?
  17. > Thanks!
  18. > -eric
  19. I talked to Andrew about what files he changed in GCC and created and
  20. tested this new patch. Andrew also mentioned changing some assembly
  21. files in glibc but I don't see any use of '.section .note.GNU-stack' in
  22. any assembly files in glibc (for any platform) so I wasn't planning on
  23. creating a glibc to add them to mips glibc assembly language files.
  24. OK to check in this patch?
  25. Steve Ellcey
  26. sellcey@mips.com
  27. 2014-09-26 Steve Ellcey <sellcey@mips.com>
  28. ---
  29. gcc/config/mips/mips.c | 3 +++
  30. libgcc/config/mips/crti.S | 4 ++++
  31. libgcc/config/mips/crtn.S | 3 +++
  32. libgcc/config/mips/mips16.S | 4 ++++
  33. libgcc/config/mips/vr4120-div.S | 4 ++++
  34. 5 files changed, 18 insertions(+)
  35. --- a/gcc/config/mips/mips.c
  36. +++ b/gcc/config/mips/mips.c
  37. @@ -22881,6 +22881,9 @@ mips_asm_file_end (void)
  38. #define TARGET_ASM_FILE_END mips_asm_file_end
  39. +#undef TARGET_ASM_FILE_END
  40. +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  41. +
  42. struct gcc_target targetm = TARGET_INITIALIZER;
  43. #include "gt-mips.h"
  44. --- a/libgcc/config/mips/crti.S
  45. +++ b/libgcc/config/mips/crti.S
  46. @@ -24,6 +24,10 @@ see the files COPYING3 and COPYING.RUNTI
  47. /* An executable stack is *not* required for these functions. */
  48. #include "gnustack.h"
  49. +
  50. +/* An executable stack is *not* required for these functions. */
  51. + .section .note.GNU-stack,"",%progbits
  52. +
  53. /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
  54. Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
  55. --- a/libgcc/config/mips/crtn.S
  56. +++ b/libgcc/config/mips/crtn.S
  57. @@ -24,6 +24,9 @@ see the files COPYING3 and COPYING.RUNTI
  58. /* An executable stack is *not* required for these functions. */
  59. #include "gnustack.h"
  60. +/* An executable stack is *not* required for these functions. */
  61. + .section .note.GNU-stack,"",%progbits
  62. +
  63. /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
  64. Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
  65. --- a/libgcc/config/mips/mips16.S
  66. +++ b/libgcc/config/mips/mips16.S
  67. @@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI
  68. values using the soft-float calling convention, but do the actual
  69. operation using the hard floating point instructions. */
  70. +/* An executable stack is *not* required for these functions. */
  71. + .section .note.GNU-stack,"",%progbits
  72. + .previous
  73. +
  74. #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64)
  75. /* This file contains 32-bit assembly code. */
  76. --- a/libgcc/config/mips/vr4120-div.S
  77. +++ b/libgcc/config/mips/vr4120-div.S
  78. @@ -29,6 +29,10 @@ see the files COPYING3 and COPYING.RUNTI
  79. -mfix-vr4120. div and ddiv do not give the correct result when one
  80. of the operands is negative. */
  81. +/* An executable stack is *not* required for these functions. */
  82. + .section .note.GNU-stack,"",%progbits
  83. + .previous
  84. +
  85. .set nomips16
  86. #define DIV \