# SPDX-License-Identifier: GPL-2.0
# ===========================================================================
# Module versions
# ===========================================================================
#
# Stage one of module building created the following:
# a) The individual .o files used for the module
# b) A <module>.o file which is the .o files above linked together
# c) A <module>.mod file, listing the name of the preliminary <module>.o file,
#    plus all .o files
# d) modules.order, which lists all the modules

# Stage 2 is handled by this file and does the following
# 1) Find all modules listed in modules.order
# 2) modpost is then used to
# 3)  create one <module>.mod.c file per module
# 4)  create one Module.symvers file with CRC for all exported symbols

# Step 3 is used to place certain information in the module's ELF
# section, including information such as:
#   Version magic (see include/linux/vermagic.h for full details)
#     - Kernel release
#     - SMP is CONFIG_SMP
#     - PREEMPT is CONFIG_PREEMPT[_RT]
#     - GCC Version
#   Module info
#     - Module version (MODULE_VERSION)
#     - Module alias'es (MODULE_ALIAS)
#     - Module license (MODULE_LICENSE)
#     - See include/linux/module.h for more details

# Step 4 is solely used to allow module versioning in external modules,
# where the CRC of each module is retrieved from the Module.symvers file.

PHONY := __modpost
__modpost:

include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include

MODPOST = scripts/mod/modpost

modpost-args =										\
	$(if $(CONFIG_MODVERSIONS),-m)							\
	$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a)					\
	$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)					\
	$(if $(KBUILD_MODPOST_WARN),-w)							\
	$(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS))					\
	$(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N)	\
	$(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W)					\
	-o $@

modpost-deps := $(MODPOST)

# 'make -i -k' ignores compile errors, and builds as many modules as possible.
ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),)
modpost-args += -n
endif

# Read out modules.order to pass in modpost.
# Otherwise, allmodconfig would fail with "Argument list too long".
ifdef KBUILD_MODULES
modpost-args += -T $(MODORDER)
modpost-deps += $(MODORDER)
endif

ifeq ($(KBUILD_EXTMOD),)

# Generate the list of in-tree objects in vmlinux
# ---------------------------------------------------------------------------

# This is used to retrieve symbol versions generated by genksyms.
ifdef CONFIG_MODVERSIONS
vmlinux.symvers Module.symvers: .vmlinux.objs
endif

# Ignore libgcc.a
# Some architectures do '$(CC) --print-libgcc-file-name' to borrow libgcc.a
# from the toolchain, but there is no EXPORT_SYMBOL in it.

quiet_cmd_vmlinux_objs = GEN     $@
      cmd_vmlinux_objs =		\
	for f in $(real-prereqs); do	\
		case $${f} in		\
		*libgcc.a) ;;		\
		*) $(AR) t $${f} ;;	\
		esac			\
	done > $@

targets += .vmlinux.objs
.vmlinux.objs: vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE
	$(call if_changed,vmlinux_objs)

ifdef CONFIG_TRIM_UNUSED_KSYMS
ksym-wl := $(CONFIG_UNUSED_KSYMS_WHITELIST)
ksym-wl := $(if $(filter-out /%, $(ksym-wl)),$(srctree)/)$(ksym-wl)
modpost-args += -t $(addprefix -u , $(ksym-wl))
modpost-deps += $(ksym-wl)
endif

ifeq ($(wildcard vmlinux.o),)
missing-input := vmlinux.o
output-symdump := modules-only.symvers
else
modpost-args += vmlinux.o
modpost-deps += vmlinux.o
output-symdump := $(if $(KBUILD_MODULES), Module.symvers, vmlinux.symvers)
endif

else

# set src + obj - they may be used in the modules's Makefile
obj := $(KBUILD_EXTMOD)
src := $(obj)

# Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS
include $(kbuild-file)

output-symdump := $(KBUILD_EXTMOD)/Module.symvers

ifeq ($(wildcard Module.symvers),)
missing-input := Module.symvers
else
modpost-args += -i Module.symvers
modpost-deps += Module.symvers
endif

modpost-args += -e $(addprefix -i , $(KBUILD_EXTRA_SYMBOLS))

endif # ($(KBUILD_EXTMOD),)

quiet_cmd_modpost = MODPOST $@
      cmd_modpost = \
	$(if $(missing-input), \
		echo >&2 "WARNING: $(missing-input) is missing."; \
		echo >&2 "         Modules may not have dependencies or modversions."; \
		echo >&2 "         You may get many unresolved symbol errors."; \
		echo >&2 "         You can set KBUILD_MODPOST_WARN=1 to turn errors into warning"; \
		echo >&2 "         if you want to proceed at your own risk.";) \
	$(MODPOST) $(modpost-args)

targets += $(output-symdump)
$(output-symdump): $(modpost-deps) FORCE
	$(call if_changed,modpost)

__modpost: $(output-symdump)
PHONY += FORCE
FORCE:

existing-targets := $(wildcard $(sort $(targets)))

-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)

.PHONY: $(PHONY)
