Author: emaste
Date: Wed Oct 11 19:26:39 2017
New Revision: 324536
URL: https://svnweb.freebsd.org/changeset/base/324536

Log:
  libunwind: use upstream patch to disable executable stacks
  
  arm uses '@' as a comment character, and cannot use @progbits in the
  .section directive. Apply the upstream noexec stach change which avoids
  this issue.
  
  Obtained from:        LLVM r277868

Modified:
  head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S
  head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S
  head/contrib/llvm/projects/libunwind/src/assembly.h

Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S
==============================================================================
--- head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S   Wed Oct 
11 18:25:05 2017        (r324535)
+++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S   Wed Oct 
11 19:26:39 2017        (r324536)
@@ -528,4 +528,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Regis
 
 #endif
 
-  .section .note.GNU-stack,"",@progbits
+NO_EXEC_STACK_DIRECTIVE
+

Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S
==============================================================================
--- head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S      Wed Oct 
11 18:25:05 2017        (r324535)
+++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S      Wed Oct 
11 19:26:39 2017        (r324536)
@@ -470,4 +470,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext)
 
 #endif
 
-    .section .note.GNU-stack,"",@progbits
+NO_EXEC_STACK_DIRECTIVE
+

Modified: head/contrib/llvm/projects/libunwind/src/assembly.h
==============================================================================
--- head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 18:25:05 
2017        (r324535)
+++ head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 19:26:39 
2017        (r324536)
@@ -35,19 +35,34 @@
 #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
 
 #if defined(__APPLE__)
+
 #define SYMBOL_IS_FUNC(name)
+#define NO_EXEC_STACK_DIRECTIVE
+
 #elif defined(__ELF__)
+
 #if defined(__arm__)
 #define SYMBOL_IS_FUNC(name) .type name,%function
 #else
 #define SYMBOL_IS_FUNC(name) .type name,@function
 #endif
+
+#if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__)
+#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
 #else
+#define NO_EXEC_STACK_DIRECTIVE
+#endif
+
+#else
+
 #define SYMBOL_IS_FUNC(name)                                                   
\
   .def name SEPARATOR                                                          
\
     .scl 2 SEPARATOR                                                           
\
     .type 32 SEPARATOR                                                         
\
   .endef
+
+#define NO_EXEC_STACK_DIRECTIVE
+
 #endif
 
 #define DEFINE_LIBUNWIND_FUNCTION(name)                   \
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to