diff options
-rw-r--r-- | insmod.c | 13 | ||||
-rw-r--r-- | modutils/insmod.c | 13 |
2 files changed, 18 insertions, 8 deletions
@@ -130,7 +130,7 @@ | |||
130 | #ifndef MODUTILS_MODULE_H | 130 | #ifndef MODUTILS_MODULE_H |
131 | static const int MODUTILS_MODULE_H = 1; | 131 | static const int MODUTILS_MODULE_H = 1; |
132 | 132 | ||
133 | #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $" | 133 | #ident "$Id: insmod.c,v 1.67 2001/06/28 21:36:06 andersen Exp $" |
134 | 134 | ||
135 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 135 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
136 | We do not use the kernel headers directly because we do not wish | 136 | We do not use the kernel headers directly because we do not wish |
@@ -347,7 +347,7 @@ int delete_module(const char *); | |||
347 | #ifndef MODUTILS_OBJ_H | 347 | #ifndef MODUTILS_OBJ_H |
348 | static const int MODUTILS_OBJ_H = 1; | 348 | static const int MODUTILS_OBJ_H = 1; |
349 | 349 | ||
350 | #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $" | 350 | #ident "$Id: insmod.c,v 1.67 2001/06/28 21:36:06 andersen Exp $" |
351 | 351 | ||
352 | /* The relocatable object is manipulated using elfin types. */ | 352 | /* The relocatable object is manipulated using elfin types. */ |
353 | 353 | ||
@@ -1460,8 +1460,13 @@ struct obj_symbol *obj_add_symbol(struct obj_file *f, const char *name, | |||
1460 | f->symtab[hash] = sym; | 1460 | f->symtab[hash] = sym; |
1461 | sym->ksymidx = -1; | 1461 | sym->ksymidx = -1; |
1462 | 1462 | ||
1463 | if (ELFW(ST_BIND) (info) == STB_LOCAL) | 1463 | if (ELFW(ST_BIND)(info) == STB_LOCAL && symidx != -1) { |
1464 | f->local_symtab[symidx] = sym; | 1464 | if (symidx >= f->local_symtab_size) |
1465 | error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld", | ||
1466 | name, (long) symidx, (long) f->local_symtab_size); | ||
1467 | else | ||
1468 | f->local_symtab[symidx] = sym; | ||
1469 | } | ||
1465 | 1470 | ||
1466 | found: | 1471 | found: |
1467 | sym->name = name; | 1472 | sym->name = name; |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 71f76c750..4b0051594 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -130,7 +130,7 @@ | |||
130 | #ifndef MODUTILS_MODULE_H | 130 | #ifndef MODUTILS_MODULE_H |
131 | static const int MODUTILS_MODULE_H = 1; | 131 | static const int MODUTILS_MODULE_H = 1; |
132 | 132 | ||
133 | #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $" | 133 | #ident "$Id: insmod.c,v 1.67 2001/06/28 21:36:06 andersen Exp $" |
134 | 134 | ||
135 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 135 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
136 | We do not use the kernel headers directly because we do not wish | 136 | We do not use the kernel headers directly because we do not wish |
@@ -347,7 +347,7 @@ int delete_module(const char *); | |||
347 | #ifndef MODUTILS_OBJ_H | 347 | #ifndef MODUTILS_OBJ_H |
348 | static const int MODUTILS_OBJ_H = 1; | 348 | static const int MODUTILS_OBJ_H = 1; |
349 | 349 | ||
350 | #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $" | 350 | #ident "$Id: insmod.c,v 1.67 2001/06/28 21:36:06 andersen Exp $" |
351 | 351 | ||
352 | /* The relocatable object is manipulated using elfin types. */ | 352 | /* The relocatable object is manipulated using elfin types. */ |
353 | 353 | ||
@@ -1460,8 +1460,13 @@ struct obj_symbol *obj_add_symbol(struct obj_file *f, const char *name, | |||
1460 | f->symtab[hash] = sym; | 1460 | f->symtab[hash] = sym; |
1461 | sym->ksymidx = -1; | 1461 | sym->ksymidx = -1; |
1462 | 1462 | ||
1463 | if (ELFW(ST_BIND) (info) == STB_LOCAL) | 1463 | if (ELFW(ST_BIND)(info) == STB_LOCAL && symidx != -1) { |
1464 | f->local_symtab[symidx] = sym; | 1464 | if (symidx >= f->local_symtab_size) |
1465 | error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld", | ||
1466 | name, (long) symidx, (long) f->local_symtab_size); | ||
1467 | else | ||
1468 | f->local_symtab[symidx] = sym; | ||
1469 | } | ||
1465 | 1470 | ||
1466 | found: | 1471 | found: |
1467 | sym->name = name; | 1472 | sym->name = name; |