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