[PATCH] kbuild: modpost needs to cope with new glibc elf header on sparc
Recently a change in the glibc elf.h header has been introduced causing modpost to spawn tons of warnings (like the one below) building the kernel on sparc: [SNIP] *** Warning: "current_thread_info_reg" [net/sunrpc/auth_gss/auth_rpcgss.ko] undefined! *** Warning: "" [net/sunrpc/auth_gss/auth_rpcgss.ko] undefined! *** Warning: "" [net/sunrpc/auth_gss/auth_rpcgss.ko] undefined! [SNIP] Ben Collins discovered that the STT_REGISTERED definition in glibc did change and that this change needs to be propagated to modpost. glibc change: -#define STT_REGISTER 13 /* Global register reserved to app. */ +#define STT_SPARC_REGISTER 13 /* Global register reserved to app. */ I did and tested this simple patch to maintain compatibility with newer (>= 2.3.4) and older (<= 2.3.2) glibc. Signed-off-by: Fabio M. Di Nitto <fabbione@fabbione.net> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
committed by
Sam Ravnborg
parent
6d983feab8
commit
b95d4fec89
@@ -359,11 +359,16 @@ handle_modversions(struct module *mod, struct elf_info *info,
|
|||||||
/* ignore __this_module, it will be resolved shortly */
|
/* ignore __this_module, it will be resolved shortly */
|
||||||
if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
|
if (strcmp(symname, MODULE_SYMBOL_PREFIX "__this_module") == 0)
|
||||||
break;
|
break;
|
||||||
#ifdef STT_REGISTER
|
/* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */
|
||||||
|
#if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER)
|
||||||
|
/* add compatibility with older glibc */
|
||||||
|
#ifndef STT_SPARC_REGISTER
|
||||||
|
#define STT_SPARC_REGISTER STT_REGISTER
|
||||||
|
#endif
|
||||||
if (info->hdr->e_machine == EM_SPARC ||
|
if (info->hdr->e_machine == EM_SPARC ||
|
||||||
info->hdr->e_machine == EM_SPARCV9) {
|
info->hdr->e_machine == EM_SPARCV9) {
|
||||||
/* Ignore register directives. */
|
/* Ignore register directives. */
|
||||||
if (ELF_ST_TYPE(sym->st_info) == STT_REGISTER)
|
if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user