depmod oopses + workaround patch

Richard Henderson (richard@atheist.tamu.edu)
Tue, 4 Feb 1997 15:10:07 -0600 (CST)


I think it was Edouard Parmelan who noticed first, but I have
verified that all reported oopsing in depmod is due to broken
binutils.

Please make sure you are using 2.7.0.4 or later. The patch
below is no substitute for fixing the actual bug. I believe
HJ has 2.7.0.8 on tsx-11 now, so if in doubt get it.

r~

--- linux/kernel/module.c.orig Wed Jan 29 05:40:34 1997
+++ linux/kernel/module.c Tue Feb 4 14:41:07 1997
@@ -62,7 +62,22 @@ static void free_module(struct module *)

void init_modules(void)
{
+ struct module_symbol *start;
+
kernel_module.nsyms = __stop___ksymtab - __start___ksymtab;
+
+ /* Work around a bug in binutils < 2.7.0.4 ish that doesn't match
+ up magic section symbols with the section they belong with. */
+
+ start = __stop___ksymtab - kernel_module.nsyms;
+ if (start != __start___ksymtab) {
+ printk(KERN_WARNING "Binutils broken -- "
+ "ksymtab start symbol not aligned\n");
+
+ kernel_module.syms = start;
+ kernel_module.ex_table_start = __stop___ex_table -
+ (__stop___ex_table - __start___ex_table);
+ }

#ifdef __alpha__
{