arm64: unwind: add asynchronous unwind tables to kernel and modules
[sfrench/cifs-2.6.git] / include / asm-generic / vmlinux.lds.h
index d06ada2341cb9e2fdcdbd07a846646b8d94856f9..0cca179e510649b1e719715d0c7f0a2dc19056ca 100644 (file)
  * keep any .init_array.* sections.
  * https://bugs.llvm.org/show_bug.cgi?id=46478
  */
+#ifdef CONFIG_UNWIND_TABLES
+#define DISCARD_EH_FRAME
+#else
+#define DISCARD_EH_FRAME       *(.eh_frame)
+#endif
 #if defined(CONFIG_GCOV_KERNEL) || defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KCSAN)
 # ifdef CONFIG_CONSTRUCTORS
 #  define SANITIZER_DISCARDS                                           \
-       *(.eh_frame)
+       DISCARD_EH_FRAME
 # else
 #  define SANITIZER_DISCARDS                                           \
        *(.init_array) *(.init_array.*)                                 \
-       *(.eh_frame)
+       DISCARD_EH_FRAME
 # endif
 #else
 # define SANITIZER_DISCARDS