History

kbuild: refactor cmd_modversions_S

Split the code into two macros, cmd_gen_symversions_S for running genksyms, and cmd_modversions for running $(LD) to update the object with CRCs.

Masahiro Yamada committed 4 years ago

Commit 7cfa2fc1 parent 8017ce51 file · +4 −11Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/Makefile.build+4−11
@@ -276,7 +276,8 @@ define rule_as_o_S · 275 unmodified lines
276 $(call cmd_and_fixdep,as_o_S)276 $(call cmd_and_fixdep,as_o_S)
277 $(call cmd,gen_ksymdeps)277 $(call cmd,gen_ksymdeps)
278 $(call cmd,gen_objtooldep)278 $(call cmd,gen_objtooldep)
279 $(call cmd,modversions_S)279 $(call cmd,gen_symversions_S)
280 $(call cmd,modversions)
280endef281endef
281 282
282# Built-in and composite module parts283# Built-in and composite module parts
@@ -363,16 +364,8 @@ ifdef CONFIG_ASM_MODVERSIONS · 80 unmodified lines
363# versioning matches the C process described above, with difference that364# versioning matches the C process described above, with difference that
364# we parse asm-prototypes.h C header to get function definitions.365# we parse asm-prototypes.h C header to get function definitions.
365 366
366cmd_modversions_S = \367cmd_gen_symversions_S = $(call gen_symversions,S)
367 if $(OBJDUMP) -h $@ | grep -q __ksymtab; then \368
368 $(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
369 > $(@D)/.tmp_$(@F:.o=.ver); \
370 \
371 $(LD) $(KBUILD_LDFLAGS) -r -o $(@D)/.tmp_$(@F) $@ \
372 -T $(@D)/.tmp_$(@F:.o=.ver); \
373 mv -f $(@D)/.tmp_$(@F) $@; \
374 rm -f $(@D)/.tmp_$(@F:.o=.ver); \
375 fi
376endif369endif
377 370
378$(obj)/%.o: $(src)/%.S FORCE371$(obj)/%.o: $(src)/%.S FORCE