Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Dec 2017 14:26:15 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r327201 - stable/11/contrib/llvm/projects/libunwind/src
Message-ID:  <201712261426.vBQEQFid021748@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue Dec 26 14:26:15 2017
New Revision: 327201
URL: https://svnweb.freebsd.org/changeset/base/327201

Log:
  MFC r324536 (by emaste):
  
  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:
  stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S
  stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S
  stable/11/contrib/llvm/projects/libunwind/src/assembly.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S
==============================================================================
--- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S	Tue Dec 26 12:35:02 2017	(r327200)
+++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S	Tue Dec 26 14:26:15 2017	(r327201)
@@ -484,4 +484,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind14Regis
 
 #endif
 
-  .section .note.GNU-stack,"",@progbits
+NO_EXEC_STACK_DIRECTIVE
+

Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S
==============================================================================
--- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S	Tue Dec 26 12:35:02 2017	(r327200)
+++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S	Tue Dec 26 14:26:15 2017	(r327201)
@@ -470,4 +470,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext)
 
 #endif
 
-    .section .note.GNU-stack,"",@progbits
+NO_EXEC_STACK_DIRECTIVE
+

Modified: stable/11/contrib/llvm/projects/libunwind/src/assembly.h
==============================================================================
--- stable/11/contrib/llvm/projects/libunwind/src/assembly.h	Tue Dec 26 12:35:02 2017	(r327200)
+++ stable/11/contrib/llvm/projects/libunwind/src/assembly.h	Tue Dec 26 14:26:15 2017	(r327201)
@@ -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)                   \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712261426.vBQEQFid021748>