Makefile.gate 962 B

123456789101112131415161718192021222324252627282930
  1. # SPDX-License-Identifier: GPL-2.0
  2. # The gate DSO image is built using a special linker script.
  3. targets += gate.so gate.lds gate.o gate-dummy.o
  4. obj-y += gate-syms.o
  5. CPPFLAGS_gate.lds := -P -C -U$(ARCH)
  6. quiet_cmd_gate = GATE $@
  7. cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@
  8. GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
  9. $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
  10. $(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
  11. $(call if_changed,gate)
  12. GATECFLAGS_gate-dummy.o = -r
  13. $(obj)/gate-dummy.o: $(obj)/gate.lds $(obj)/gate.o FORCE
  14. $(call if_changed,gate)
  15. LDFLAGS_gate-syms.o := -r -R
  16. $(obj)/gate-syms.o: $(obj)/gate-dummy.o FORCE
  17. $(call if_changed,ld)
  18. # gate-data.o contains the gate DSO image as data in section .data..gate.
  19. # We must build gate.so before we can assemble it.
  20. # Note: kbuild does not track this dependency due to usage of .incbin
  21. $(obj)/gate-data.o: $(obj)/gate.so