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