History

module: fix symbol versioning with symbol prefixes

Fix symbol versioning on architectures with symbol prefixes. Although the build was free from warnings the actual modules still wouldn't load as the ____versions table contained unprefixed symbol names, which were being compared against the prefixed symbol names when checking the symbol versions. This is fixed by modifying modpost to add the symbol prefix to the ____versions table it outputs (Modules.symvers still contains unprefixed symbol names). The check_modstruct_version() function is also fixed as it checks the version of the unprefixed "module_layout" symbol which would no longer work.

James Hogan committed 13 years ago

Commit a4b6a771 parent b92021b2 files · +4 −2Browse files

Showing the changes to kernel/module.c (1 of 2 files). Show all

Unified · Split

kernel/module.c+2−1
@@ -1212,7 +1212,8 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs, · 1211 unmodified lines
1212 if (!find_symbol(VMLINUX_SYMBOL_STR(module_layout), NULL,1212 if (!find_symbol(VMLINUX_SYMBOL_STR(module_layout), NULL,
1213 &crc, true, false))1213 &crc, true, false))
1214 BUG();1214 BUG();
1215 return check_version(sechdrs, versindex, "module_layout", mod, crc,1215 return check_version(sechdrs, versindex,
1216 VMLINUX_SYMBOL_STR(module_layout), mod, crc,
1216 NULL);1217 NULL);
1217}1218}
1218 1219