|
|
@@ -2383,7 +2383,7 @@ static char elf_type(const Elf_Sym *sym, const struct load_info *info)
|
|
|
}
|
|
|
if (sym->st_shndx == SHN_UNDEF)
|
|
|
return 'U';
|
|
|
- if (sym->st_shndx == SHN_ABS)
|
|
|
+ if (sym->st_shndx == SHN_ABS || sym->st_shndx == info->index.pcpu)
|
|
|
return 'a';
|
|
|
if (sym->st_shndx >= SHN_LORESERVE)
|
|
|
return '?';
|
|
|
@@ -2412,7 +2412,7 @@ static char elf_type(const Elf_Sym *sym, const struct load_info *info)
|
|
|
}
|
|
|
|
|
|
static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs,
|
|
|
- unsigned int shnum)
|
|
|
+ unsigned int shnum, unsigned int pcpundx)
|
|
|
{
|
|
|
const Elf_Shdr *sec;
|
|
|
|
|
|
@@ -2421,6 +2421,11 @@ static bool is_core_symbol(const Elf_Sym *src, const Elf_Shdr *sechdrs,
|
|
|
|| !src->st_name)
|
|
|
return false;
|
|
|
|
|
|
+#ifdef CONFIG_KALLSYMS_ALL
|
|
|
+ if (src->st_shndx == pcpundx)
|
|
|
+ return true;
|
|
|
+#endif
|
|
|
+
|
|
|
sec = sechdrs + src->st_shndx;
|
|
|
if (!(sec->sh_flags & SHF_ALLOC)
|
|
|
#ifndef CONFIG_KALLSYMS_ALL
|
|
|
@@ -2458,7 +2463,8 @@ static void layout_symtab(struct module *mod, struct load_info *info)
|
|
|
/* Compute total space required for the core symbols' strtab. */
|
|
|
for (ndst = i = 0; i < nsrc; i++) {
|
|
|
if (i == 0 ||
|
|
|
- is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) {
|
|
|
+ is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum,
|
|
|
+ info->index.pcpu)) {
|
|
|
strtab_size += strlen(&info->strtab[src[i].st_name])+1;
|
|
|
ndst++;
|
|
|
}
|
|
|
@@ -2500,7 +2506,8 @@ static void add_kallsyms(struct module *mod, const struct load_info *info)
|
|
|
src = mod->symtab;
|
|
|
for (ndst = i = 0; i < mod->num_symtab; i++) {
|
|
|
if (i == 0 ||
|
|
|
- is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum)) {
|
|
|
+ is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum,
|
|
|
+ info->index.pcpu)) {
|
|
|
dst[ndst] = src[i];
|
|
|
dst[ndst++].st_name = s - mod->core_strtab;
|
|
|
s += strlcpy(s, &mod->strtab[src[i].st_name],
|