| 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | targets += trampoline_$(BITS).o purgatory.ro |
| 4 | |
| 5 | # When profile-guided optimization is enabled, llvm emits two different |
| 6 | # overlapping text sections, which is not supported by kexec. Remove profile |
| 7 | # optimization flags. |
| 8 | KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%,$(KBUILD_CFLAGS)) |
| 9 | |
| 10 | LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined |
| 11 | |
| 12 | $(obj)/purgatory.ro: $(obj)/trampoline_$(BITS).o FORCE |
| 13 | $(call if_changed,ld) |
| 14 | |
| 15 | $(obj)/kexec-purgatory.o: $(obj)/purgatory.ro |
| 16 | |
| 17 | obj-y += kexec-purgatory.o |