From 4fd79b90c52396d70e0b1206ceb1a873a0ad2589 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 23 Dec 2020 06:49:04 -0800 Subject: liblzma: Enable Intel CET in x86 CRC assembly codes When Intel CET is enabled, we need to include in assembly codes to mark Intel CET support and add _CET_ENDBR to indirect jump targets. Tested on Intel Tiger Lake under CET enabled Linux. --- src/liblzma/check/crc32_x86.S | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/liblzma/check/crc32_x86.S') diff --git a/src/liblzma/check/crc32_x86.S b/src/liblzma/check/crc32_x86.S index 632c7b37..7814beca 100644 --- a/src/liblzma/check/crc32_x86.S +++ b/src/liblzma/check/crc32_x86.S @@ -51,6 +51,14 @@ init_table(void) * extern uint32_t lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc); */ +/* When Intel CET is enabled, include in assembly code to mark + Intel CET support. */ +#ifdef __CET__ +# include +#else +# define _CET_ENDBR +#endif + /* * On some systems, the functions need to be prefixed. The prefix is * usually an underscore. @@ -83,6 +91,7 @@ init_table(void) ALIGN(4, 16) LZMA_CRC32: + _CET_ENDBR /* * Register usage: * %eax crc -- cgit v1.2.3