]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Use non-executable stack on FreeBSD as on Linux
authorEd Maste <emaste@FreeBSD.org>
Fri, 11 Feb 2022 15:25:46 +0000 (15:25 +0000)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 21 Feb 2022 23:23:34 +0000 (01:23 +0200)
src/liblzma/check/crc32_x86.S
src/liblzma/check/crc64_x86.S

index 7814beca90f9be6398e7c12350925743ab46bc06..4f395df8122af5c09965c3841abf4c5e799e3178 100644 (file)
@@ -305,9 +305,9 @@ LZMA_CRC32:
 
 /*
  * This is needed to support non-executable stack. It's ugly to
- * use __linux__ here, but I don't know a way to detect when
+ * use __FreeBSD__ and __linux__ here, but I don't know a way to detect when
  * we are using GNU assembler.
  */
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__))
        .section        .note.GNU-stack,"",@progbits
 #endif
index 7ee08f64f3b5d712f1d11de7d86b4e9cb2b245c8..9aecf5865455f0561d5fb37dbe5b29d4abad716e 100644 (file)
@@ -288,9 +288,9 @@ LZMA_CRC64:
 
 /*
  * This is needed to support non-executable stack. It's ugly to
- * use __linux__ here, but I don't know a way to detect when
+ * use __FreeBSD__ and __linux__ here, but I don't know a way to detect when
  * we are using GNU assembler.
  */
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__))
        .section        .note.GNU-stack,"",@progbits
 #endif