Re: Modules 2.1.8 problem report

Keith Owens (kaos@edison.dialix.com.au)
Tue, 19 Nov 1996 10:23:47 +1100 (EST)


On Mon, 18 Nov 1996, Richard Gooch wrote:
> Hi. I just tried modules 2.1.8, built with the 2.0.0 include files,
> running on 2.0.22. I can install "sr_mod", but when I try installing
> "isofs" I get a segmentation fault. Is this a known problem (i.e. is
> modules 2.1.8 known to not work with 2.0.22)? If not, is there any
> further information I can supply?

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))