summaryrefslogtreecommitdiff
path: root/scripts/Makefile.vmlinux
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-10-09 21:20:03 +0200
committerMark Brown <broonie@kernel.org>2026-10-09 21:20:03 +0200
commit42e6288df48dbec158b14d7ffaf170bd6febfd31 (patch)
tree5e03b05fdd02126d86df6568e1180a7420aeeb78 /scripts/Makefile.vmlinux
parent7f1e046d644d54d477b0d1dc887e25b39551be18 (diff)
parent20cb500b2dfd87e055b2a494665121d0c7d20f76 (diff)
downloadlinux-next-42e6288df48dbec158b14d7ffaf170bd6febfd31.tar.gz
linux-next-42e6288df48dbec158b14d7ffaf170bd6febfd31.zip
Merge branch 'kbuild-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git
# Conflicts: # init/Kconfig # scripts/kallsyms.c # scripts/remove-stale-files
Diffstat (limited to 'scripts/Makefile.vmlinux')
-rw-r--r--scripts/Makefile.vmlinux20
1 files changed, 2 insertions, 18 deletions
diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index fcae1e432d9a..95b523fe4f9e 100644
--- a/scripts/Makefile.vmlinux
+++ b/scripts/Makefile.vmlinux
@@ -89,11 +89,8 @@ remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel.*'
remove-symbols := -w --strip-unneeded-symbol='__mod_device_table__*'
-# To avoid warnings: "empty loadable segment detected at ..." from GNU objcopy,
-# it is necessary to remove the PT_LOAD flag from the segment.
quiet_cmd_strip_relocs = OBJCOPY $@
- cmd_strip_relocs = $(OBJCOPY) $(patsubst %,--set-section-flags %=noload,$(remove-section-y)) $< $@; \
- $(OBJCOPY) $(addprefix --remove-section=,$(remove-section-y)) $(remove-symbols) $@
+ cmd_strip_relocs = $(OBJCOPY) $(addprefix --remove-section=,$(remove-section-y)) $(remove-symbols) $< $@
targets += vmlinux
vmlinux: vmlinux.unstripped FORCE
@@ -102,21 +99,8 @@ vmlinux: vmlinux.unstripped FORCE
# modules.builtin.modinfo
# ---------------------------------------------------------------------------
-# .modinfo in vmlinux.unstripped is aligned to 8 bytes for compatibility with
-# tools that expect vmlinux to have sufficiently aligned sections but the
-# additional bytes used for padding .modinfo to satisfy this requirement break
-# certain versions of kmod with
-#
-# depmod: ERROR: kmod_builtin_iter_next: unexpected string without modname prefix
-#
-# Strip the trailing padding bytes after extracting .modinfo to comply with
-# what kmod expects to parse.
quiet_cmd_modules_builtin_modinfo = GEN $@
- cmd_modules_builtin_modinfo = $(cmd_objcopy); \
- sed -i 's/\x00\+$$/\x00/g' $@; \
- chmod -x $@
-
-OBJCOPYFLAGS_modules.builtin.modinfo := -j .modinfo -O binary
+ cmd_modules_builtin_modinfo = $(OBJCOPY) -O binary -j .modinfo --dump-section .modinfo=$@ $< /dev/null
targets += modules.builtin.modinfo
modules.builtin.modinfo: vmlinux.unstripped FORCE