Makefile.gate 924 B

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