From: Stephen Rothwell <sfr@canb.auug.org.au>
To: sam@ravnborg.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] PowerPC64 symbols start with '.'
Date: Fri, 11 May 2007 15:45:01 +1000 [thread overview]
Message-ID: <20070511154501.1961fb92.sfr@canb.auug.org.au> (raw)
which we want to skip during modpost processing. We need this to make
some of the whitelisting work.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
scripts/mod/modpost.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 113dc77..748b058 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -164,7 +164,13 @@ static inline unsigned int tdb_hash(const char *name)
static struct symbol *alloc_symbol(const char *name, unsigned int weak,
struct symbol *next)
{
- struct symbol *s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));
+ struct symbol *s;
+
+ /* For our purposes, .foo matches foo. PPC64 needs this. */
+ if (name[0] == '.')
+ name++;
+
+ s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));
memset(s, 0, sizeof(*s));
strcpy(s->name, name);
@@ -180,6 +186,10 @@ static struct symbol *new_symbol(const char *name, struct module *module,
unsigned int hash;
struct symbol *new;
+ /* For our purposes, .foo matches foo. PPC64 needs this. */
+ if (name[0] == '.')
+ name++;
+
hash = tdb_hash(name) % SYMBOL_HASH_SIZE;
new = symbolhash[hash] = alloc_symbol(name, 0, symbolhash[hash]);
new->module = module;
@@ -684,6 +694,12 @@ static int secref_whitelist(const char *modname, const char *tosec,
NULL
};
+ /* For our purposes, .foo matches foo. PPC64 needs this. */
+ if (atsym[0] == '.')
+ atsym++;
+ if (refsymname[0] == '.')
+ refsymname++;
+
/* Check for pattern 1 */
if (strcmp(tosec, ".init.data") != 0)
f1 = 0;
--
1.5.1.4
next reply other threads:[~2007-05-11 5:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-11 5:45 Stephen Rothwell [this message]
2007-05-15 20:39 ` Sam Ravnborg
2007-05-16 3:59 ` Stephen Rothwell
2007-05-16 20:21 ` Sam Ravnborg
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=20070511154501.1961fb92.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.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
all inboxes | Powered by JetHome®