mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
[MIPS] Ignore unresolved weak symbols in modules.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
320e6aba26
commit
f3bf07b9a3
@ -288,6 +288,9 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
|
|||||||
sym = (Elf_Sym *)sechdrs[symindex].sh_addr
|
sym = (Elf_Sym *)sechdrs[symindex].sh_addr
|
||||||
+ ELF_MIPS_R_SYM(rel[i]);
|
+ ELF_MIPS_R_SYM(rel[i]);
|
||||||
if (!sym->st_value) {
|
if (!sym->st_value) {
|
||||||
|
/* Ignore unresolved weak symbol */
|
||||||
|
if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
|
||||||
|
continue;
|
||||||
printk(KERN_WARNING "%s: Unknown symbol %s\n",
|
printk(KERN_WARNING "%s: Unknown symbol %s\n",
|
||||||
me->name, strtab + sym->st_name);
|
me->name, strtab + sym->st_name);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
@ -325,6 +328,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
|
|||||||
sym = (Elf_Sym *)sechdrs[symindex].sh_addr
|
sym = (Elf_Sym *)sechdrs[symindex].sh_addr
|
||||||
+ ELF_MIPS_R_SYM(rel[i]);
|
+ ELF_MIPS_R_SYM(rel[i]);
|
||||||
if (!sym->st_value) {
|
if (!sym->st_value) {
|
||||||
|
/* Ignore unresolved weak symbol */
|
||||||
|
if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
|
||||||
|
continue;
|
||||||
printk(KERN_WARNING "%s: Unknown symbol %s\n",
|
printk(KERN_WARNING "%s: Unknown symbol %s\n",
|
||||||
me->name, strtab + sym->st_name);
|
me->name, strtab + sym->st_name);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
Loading…
Reference in New Issue
Block a user