From: Andrew Morton <akpm@linux-foundation.org>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
dhowells@redhat.com, Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH] FRV: Fix the extern declaration of kallsyms_num_syms [try #2]
Date: Thu, 15 Nov 2007 14:40:07 -0800 [thread overview]
Message-ID: <20071115144007.08760570.akpm@linux-foundation.org> (raw)
In-Reply-To: <20071113165316.18700.67752.stgit@warthog.procyon.org.uk>
On Tue, 13 Nov 2007 16:53:16 +0000
David Howells <dhowells@redhat.com> wrote:
> From: David Howells <dhowells@redhat.com>
>
> Fix the extern declaration of kallsyms_num_syms to indicate that the symbol
> does not reside in the small-data storage space, and so may not be accessed
> relative to the small data base register.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
>
> kernel/kallsyms.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
> index 474219a..2fc2581 100644
> --- a/kernel/kallsyms.c
> +++ b/kernel/kallsyms.c
> @@ -32,9 +32,14 @@
>
> /* These will be re-linked against their real values during the second link stage */
> extern const unsigned long kallsyms_addresses[] __attribute__((weak));
> -extern const unsigned long kallsyms_num_syms __attribute__((weak));
> extern const u8 kallsyms_names[] __attribute__((weak));
>
> +/* tell the compiler that the count isn't in the small data section if the arch
> + * has one (eg: FRV)
> + */
> +extern const unsigned long kallsyms_num_syms
> +__attribute__((weak, section(".rodata")));
> +
> extern const u8 kallsyms_token_table[] __attribute__((weak));
> extern const u16 kallsyms_token_index[] __attribute__((weak));
>
hm, OK, so it lines up with what scripts/kallsyms.c presently does.
But it all strikes me as a bit fragile and grotty. Perhaps longer-term it
would be better if scripts/kallsyms.c were to also emit a header file which
declares all the things which that program emits the definitions of, no?
I guess that means that we'd need to run the program twice - once at the
start of compilation in generate-the-header-file mode and once at the end
of compilation in generate-the-symbols mode.
Or something like that.
next prev parent reply other threads:[~2007-11-15 22:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 16:53 [PATCH] FRV: Fix the extern declaration of kallsyms_num_syms [try #2] David Howells
2007-11-15 22:40 ` Andrew Morton [this message]
2007-11-15 22:44 ` Andrew Morton
2007-11-15 22:55 ` David Howells
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=20071115144007.08760570.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@linux-foundation.org \
/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