diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 5ef205c5f37b094a2e0358052775f01a8fe292b0..0dac17528099c42eb538c6f3a8152431ca5c8806 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -44,7 +44,7 @@ $(obj)/vmlinux.bin: vmlinux FORCE targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs -CMD_RELOCS = arch/x86/tools/relocs +CMD_RELOCS = arch/x86/tools/relocs_$(BITS) quiet_cmd_relocs = RELOCS $@ cmd_relocs = $(CMD_RELOCS) $< > $@;$(CMD_RELOCS) --abs-relocs $< $(obj)/vmlinux.relocs: vmlinux FORCE diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile index 88692871823f9910aeb071ad44a86d8c5c251411..2b1e4294b8b972b39adf8e15b731a1c68c185569 100644 --- a/arch/x86/realmode/rm/Makefile +++ b/arch/x86/realmode/rm/Makefile @@ -56,7 +56,7 @@ $(obj)/realmode.bin: $(obj)/realmode.elf $(obj)/realmode.relocs $(call if_changed,objcopy) quiet_cmd_relocs = RELOCS $@ - cmd_relocs = arch/x86/tools/relocs --realmode $< > $@ + cmd_relocs = arch/x86/tools/relocs_32 --realmode $< > $@ targets += realmode.relocs $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE diff --git a/arch/x86/tools/.gitignore b/arch/x86/tools/.gitignore index be0ed065249b78cd69365bfa0e5b1abc288dbdb3..2b45d5f063bac02d14d640ca9c640b1e36da96b6 100644 --- a/arch/x86/tools/.gitignore +++ b/arch/x86/tools/.gitignore @@ -1 +1,2 @@ -relocs +relocs_32* +relocs_64* diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile index bae601f900ef59c09dac923c75736caf196e6e9a..a8cb70c6b8a13e04760137897ffe30754e911c63 100644 --- a/arch/x86/tools/Makefile +++ b/arch/x86/tools/Makefile @@ -37,6 +37,22 @@ $(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/in $(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c +HOSTCFLAGS_relocs_32.o += -DELF_BITS=32 +HOSTCFLAGS_relocs_64.o += -DELF_BITS=64 + +quiet_cmd_cp_reloc = GEN $@ + cmd_cp_reloc = cp $< $@ + +$(obj)/relocs_%.c: $(srctree)/arch/x86/tools/relocs.c + $(call cmd,cp_reloc) + HOST_EXTRACFLAGS += -I$(srctree)/tools/include -hostprogs-y += relocs -relocs: $(obj)/relocs +hostprogs-y += relocs_$(BITS) +relocs_binaries = relocs_$(BITS) +ifeq ($(CONFIG_64BIT),y) + hostprogs-y += relocs_32 + relocs_binaries += relocs_32 +endif +relocs: $(relocs_binaries) +relocs_32: $(obj)/relocs_32 +relocs_64: $(obj)/relocs_64