The patch below from Rob Glover <potato@dsnet.com> lets modules-2.1.8 work
with 2.0 kernels. Warning, this came from a mailing list archive and has
no tabs in it, I had to patch with --ignore-whitespace.
--- modules-2.1.8/insmod/load_elf.c~ Mon Nov 4 07:56:58 1996
+++ modules-2.1.8/insmod/load_elf.c Sun Nov 10 20:47:21 1996
@@ -366,7 +366,8 @@
}
/* JEJB: zero the bss (now it's actually allocated) */
- memset(secref[bss_seg], 0, bss_size);
+ if (bss_size)
+ memset(secref[bss_seg], 0, bss_size);
for (spnt = sections, i = 0; i < epnt->e_shnum; ++i, ++spnt) {
#ifdef __i386__
@@ -622,7 +623,9 @@
}
loaded = (char *)(((int)loaded + 3) & ~3);
- bss_size = loaded - secref[bss_seg];
+ /* yur: don't change bss_size if no bss in the module */
+ if (secref[bss_seg])
+ bss_size = loaded - secref[bss_seg];
progsize = codesize = loaded - textseg;
aout_flag = 0; /* i.e.: if it's not a.out, it _has_ to be ELF... */
if (defsym(strncmp, "_GLOBAL_OFFSET_TABLE_", loaded - textseg, N_BSS | N_EXT, TRANSIENT))