From: Rusty Russell <rusty@rustcorp.com.au>
To: Miroslav Benes <mbenes@suse.cz>
Cc: linux-kernel@vger.kernel.org, Miroslav Benes <mbenes@suse.cz>
Subject: Re: [PATCH v2] module: keep percpu symbols in module's symtab
Date: Thu, 26 Nov 2015 13:19:07 +1030 [thread overview]
Message-ID: <87bnahv5jw.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1448458422-10973-1-git-send-email-mbenes@suse.cz>
Miroslav Benes <mbenes@suse.cz> writes:
> Currently, percpu symbols from .data..percpu ELF section of a module are
> not copied over and stored in final symtab array of struct module.
> Consequently such symbol cannot be returned via kallsyms API (for
> example kallsyms_lookup_name). This can be especially confusing when the
> percpu symbol is exported. Only its __ksymtab et al. are present in its
> symtab.
>
> The culprit is in layout_and_allocate() function where SHF_ALLOC flag is
> dropped for .data..percpu section. There is in fact no need to copy the
> section to final struct module, because kernel module loader allocates
> extra percpu section by itself. Unfortunately only symbols from
> SHF_ALLOC sections are copied due to a check in is_core_symbol().
>
> The patch changes is_core_symbol() function to copy over also percpu
> symbols (their st_shndx points to .data..percpu ELF section). We do it
> only if CONFIG_KALLSYMS_ALL is set to be consistent with the rest of the
> function (ELF section is SHF_ALLOC but !SHF_EXECINSTR). Finally
> elf_type() returns type 'a' for a percpu symbol because its address is
> absolute.
>
> Signed-off-by: Miroslav Benes <mbenes@suse.cz>
Thanks, applied!
Cheers,
Rusty.
prev parent reply other threads:[~2015-11-26 3:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 13:33 [PATCH v2] module: keep percpu symbols in module's symtab Miroslav Benes
2015-11-26 2:49 ` Rusty Russell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bnahv5jw.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox