blob: 2e0aa74ac18503becc7cac6fa6db59b853bd6802 [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
Nicholas Pigginc2857372021-12-02 00:41:51 +100014lkdtm-$(CONFIG_PPC_64S_HASH_MMU) += 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 := \
Christophe Leroybc93a222021-10-08 18:58:40 +020023 --rename-section .noinstr.text=.rodata,alloc,readonly,load,contents
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)