Commit 8b4d8f66 authored by David S. Miller's avatar David S. Miller

[MODULE]: On sparc, ignore undefined symbols of type STT_REGISTER.

parent 11bef0bb
...@@ -973,6 +973,11 @@ static int simplify_symbols(Elf_Shdr *sechdrs, ...@@ -973,6 +973,11 @@ static int simplify_symbols(Elf_Shdr *sechdrs,
/* Ok if weak. */ /* Ok if weak. */
if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK) if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
break; break;
#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
/* Ok if Sparc register directive. */
if (ELF_ST_TYPE(sym[i].st_info) == STT_REGISTER)
break;
#endif
printk(KERN_WARNING "%s: Unknown symbol %s\n", printk(KERN_WARNING "%s: Unknown symbol %s\n",
mod->name, strtab + sym[i].st_name); mod->name, strtab + sym[i].st_name);
......
...@@ -296,6 +296,12 @@ handle_modversions(struct module *mod, struct elf_info *info, ...@@ -296,6 +296,12 @@ handle_modversions(struct module *mod, struct elf_info *info,
/* ignore global offset table */ /* ignore global offset table */
if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0) if (strcmp(symname, "_GLOBAL_OFFSET_TABLE_") == 0)
break; break;
if (info->hdr->e_machine == EM_SPARC ||
info->hdr->e_machine == EM_SPARCV9) {
/* Ignore register directives. */
if (ELF_ST_TYPE(sym->st_info) == STT_REGISTER)
break;
}
if (memcmp(symname, MODULE_SYMBOL_PREFIX, if (memcmp(symname, MODULE_SYMBOL_PREFIX,
strlen(MODULE_SYMBOL_PREFIX)) == 0) { strlen(MODULE_SYMBOL_PREFIX)) == 0) {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#define Elf_Shdr Elf32_Shdr #define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym #define Elf_Sym Elf32_Sym
#define ELF_ST_BIND ELF32_ST_BIND #define ELF_ST_BIND ELF32_ST_BIND
#define ELF_ST_TYPE ELF32_ST_TYPE
#else #else
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
#define Elf_Shdr Elf64_Shdr #define Elf_Shdr Elf64_Shdr
#define Elf_Sym Elf64_Sym #define Elf_Sym Elf64_Sym
#define ELF_ST_BIND ELF64_ST_BIND #define ELF_ST_BIND ELF64_ST_BIND
#define ELF_ST_TYPE ELF64_ST_TYPE
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment