diff options
| author | Keith M. Wesolowski <wesolows@foobazco.org> | 2004-02-06 00:25:56 -0800 |
|---|---|---|
| committer | Keith M. Wesolowski <wesolows@foobazco.org> | 2004-02-06 00:25:56 -0800 |
| commit | a72cdb76a21f89c9c5355cbfc92f93bcba2c7793 (patch) | |
| tree | f563bccfb028fa56f3118044b95e0288d45f2689 /scripts | |
| parent | d619064c3de3cd055f41d4554c9d92526a4f33b8 (diff) | |
[SPARC32]: Fix sparc32 module support.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/modpost.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/modpost.c b/scripts/modpost.c index 7e6a4bb035a7..1707171810e5 100644 --- a/scripts/modpost.c +++ b/scripts/modpost.c @@ -141,14 +141,26 @@ new_symbol(const char *name, struct module *module, unsigned int *crc) symbolhash[hash] = new; } +#define DOTSYM_PFX "__dot_" + struct symbol * find_symbol(const char *name) { struct symbol *s; + char dotname[64 + sizeof(DOTSYM_PFX)]; - /* For our purposes, .foo matches foo. PPC64 needs this. */ - if (name[0] == '.') + /* .foo matches foo. PPC64 needs this. */ + if (name[0] == '.') { name++; + strcpy(dotname, DOTSYM_PFX); + strncat(dotname, name, sizeof(dotname) - sizeof(DOTSYM_PFX) - 1); + dotname[sizeof(dotname)-1] = 0; + /* Sparc32 wants .foo to match __dot_foo, try this first. */ + for (s = symbolhash[tdb_hash(dotname) % SYMBOL_HASH_SIZE]; s; s=s->next) { + if (strcmp(s->name, dotname) == 0) + return s; + } + } for (s = symbolhash[tdb_hash(name) % SYMBOL_HASH_SIZE]; s; s=s->next) { if (strcmp(s->name, name) == 0) |
