Skip to content

modpost: vmlinux: section mismatch in reference: __list_add (section: .text.unlikely.) -> dir_list (section: .init.data) #2173

Description

@nickdesaulniers

Both Android and ChromeOS are hitting a modpost warning when enabling AutoFDO. They appear subtly different, but seem to be referring to the same (or similar) callers/callees:

Android:

WARNING: modpost: vmlinux: section mismatch in reference: list_add+0x0 (section: .text.hot.list_add) -> dir_list (section: .init.data)

ChromeOS

WARNING: modpost: vmlinux.o: section mismatch in reference: __list_add (section: .text.unlikely.) -> dir_list (section: .init.data)

Note: one is list_add (no __ prefix), one is __list_add. Both refer to dir_list. I recall there's some what color is your function stuff going on with __init, but forget how we've fixed these previously. It looks like dir_list is defined in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/init/initramfs.c#n155.

I suspect that the call to list_add from dir_list is being specialized for &dir_list, since dir_list is static __initdata, but the specialization isn't being placed in __init.

Thanks to @ajordanr-google for the report. Jordan can provide AutoFDO profiles (if necessary, but I think we can come up with a fix without them) and help test prospective fixes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Section mismatchA section mistmatch warning from modpost[FEATURE] AutoFDORelated to building the kernel with Automatic Feedback Directed Optimization

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions