2009-03-04 20:05:42 +08:00
|
|
|
# The gate DSO image is built using a special linker script.
|
|
|
|
|
2017-06-29 23:52:06 +08:00
|
|
|
targets += gate.so gate-syms.o gate.lds gate.o
|
2009-03-04 20:05:42 +08:00
|
|
|
|
|
|
|
CPPFLAGS_gate.lds := -P -C -U$(ARCH)
|
|
|
|
|
2017-04-12 07:36:32 +08:00
|
|
|
quiet_cmd_gate = GATE $@
|
2009-03-04 20:05:42 +08:00
|
|
|
cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@
|
|
|
|
|
|
|
|
GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \
|
2009-09-19 16:14:33 +08:00
|
|
|
$(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
|
2009-03-04 20:05:42 +08:00
|
|
|
$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
|
|
|
|
$(call if_changed,gate)
|
|
|
|
|
|
|
|
$(obj)/built-in.o: $(obj)/gate-syms.o
|
|
|
|
$(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o
|
|
|
|
|
|
|
|
GATECFLAGS_gate-syms.o = -r
|
|
|
|
$(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE
|
|
|
|
$(call if_changed,gate)
|
|
|
|
|
2010-02-20 08:03:40 +08:00
|
|
|
# gate-data.o contains the gate DSO image as data in section .data..gate.
|
2009-03-04 20:05:42 +08:00
|
|
|
# We must build gate.so before we can assemble it.
|
|
|
|
# Note: kbuild does not track this dependency due to usage of .incbin
|
|
|
|
$(obj)/gate-data.o: $(obj)/gate.so
|