blob: aa12097668d33ed9dffef72344d573982c15aed5 [file] [log] [blame]
Kees Cook039a1c422018-03-06 14:58:09 -08001# SPDX-License-Identifier: GPL-2.0
2obj-$(CONFIG_LKDTM) += lkdtm.o
3
4lkdtm-$(CONFIG_LKDTM) += core.o
5lkdtm-$(CONFIG_LKDTM) += bugs.o
6lkdtm-$(CONFIG_LKDTM) += heap.o
7lkdtm-$(CONFIG_LKDTM) += perms.o
8lkdtm-$(CONFIG_LKDTM) += refcount.o
9lkdtm-$(CONFIG_LKDTM) += rodata_objcopy.o
10lkdtm-$(CONFIG_LKDTM) += usercopy.o
Alexander Popovf90d1e02018-08-17 01:17:00 +030011lkdtm-$(CONFIG_LKDTM) += stackleak.o
Kees Cookb0eb93c2019-08-08 11:37:45 -070012lkdtm-$(CONFIG_LKDTM) += cfi.o
Francis Lanielfebebaf2020-12-15 20:43:54 -080013lkdtm-$(CONFIG_LKDTM) += fortify.o
Ganesh Goudar3ba150f2020-11-30 14:00:57 +053014lkdtm-$(CONFIG_PPC_BOOK3S_64) += powerpc.o
Kees Cook039a1c422018-03-06 14:58:09 -080015
Marco Elver6d5a88c2020-12-14 19:09:24 -080016KASAN_SANITIZE_rodata.o := n
Alexander Popovf90d1e02018-08-17 01:17:00 +030017KASAN_SANITIZE_stackleak.o := n
Kees Cook039a1c422018-03-06 14:58:09 -080018KCOV_INSTRUMENT_rodata.o := n
Sami Tolvanen01dd6332020-12-11 10:46:30 -080019CFLAGS_REMOVE_rodata.o += $(CC_FLAGS_LTO)
Kees Cook039a1c422018-03-06 14:58:09 -080020
21OBJCOPYFLAGS :=
22OBJCOPYFLAGS_rodata_objcopy.o := \
Mark Rutland3f618ab2020-12-07 17:05:33 +000023 --rename-section .noinstr.text=.rodata,alloc,readonly,load
Kees Cook039a1c422018-03-06 14:58:09 -080024targets += rodata.o rodata_objcopy.o
25$(obj)/rodata_objcopy.o: $(obj)/rodata.o FORCE
26 $(call if_changed,objcopy)