On Mon, Feb 24, 2025, at 19:42, Brian Mak wrote: > On Feb 24, 2025, at 7:12 AM, Arnd Bergmann <arnd@xxxxxxxxxx> wrote: > >> The definition of get_dump_page() is guarded by CONFIG_ELF_CORE, but >> the caller has now moved into a function that is built based on >> CONFIG_COREDUMP, which leads to a possible link failure: >> >> ld.lld-21: error: undefined symbol: get_dump_page >>>>> referenced by coredump.c >>>>> fs/coredump.o:(dump_vma_snapshot) in archive vmlinux.a > > Kernel test robot reported this issue yesterday here: > https://lore.kernel.org/oe-kbuild-all/202502231914.ROOVWMZN-lkp@xxxxxxxxx/ > https://lore.kernel.org/oe-kbuild-all/202502231818.fP8cuxmf-lkp@xxxxxxxxx/ > >> Change the #ifdef block around the definition to match the caller. >> In practice there is very little difference, as setting COREDUMP >> but not ELF_CORE is not useful. > > Good catch! I wonder if we should guard the sparse dump size calculation > logic from the get_dump_page() caller behind CONFIG_ELF_CORE instead > though. I guess the question becomes, will we ever have a non-ELF core > dump format that won't skip zero pages? > > Anyway, I'm fine with this fix as-is. The only other code that is guarded by CONFIG_COREDUMP now is the powerpc spufs, but that is only used with ELF_CORE as well. The last non-ELF coredump support was removed in 2022, earlier versions had some form of coredump for flat, a.out and som binaries. We can probably just combine ELF_CORE and COREDUMP into a single Kconfig symbol. Arnd