Re: modules 2.1.8 fix

Jacques Gelinas (jack@solucorp.qc.ca)
Mon, 11 Nov 1996 09:43:50 -0500 (EST)


On Mon, 11 Nov 1996, Heiko Eissfeldt wrote:

> --- insmod/load_elf.c~ Mon Nov 4 05:56:58 1996
> +++ insmod/load_elf.c Mon Nov 11 14:40:22 1996
> @@ -366,7 +366,7 @@
> }
>
> /* JEJB: zero the bss (now it's actually allocated) */
> - memset(secref[bss_seg], 0, bss_size);
> + memset(secref[bss_seg], bss_size, 0);
>
> for (spnt = sections, i = 0; i < epnt->e_shnum; ++i, ++spnt) {
> #ifdef __i386__

Am I missing something ? The prototype of memset is

memset (addr,character,nb_char);

Your line is equivalent to a nop. Again, am I missing something.

Some people have reported a bug about this. The bug is that some module
lack a bss. Here is the official patch I intend to include in the next
release of modules-2.1.8

*** modules-2.1.8/insmod/load_elf.c Sun Nov 3 23:56:58 1996
--- modules-2.1.8-1/insmod/load_elf.c Mon Nov 11 07:22:55 1996
***************
*** 366,372 ****
}

/* JEJB: zero the bss (now it's actually allocated) */
! memset(secref[bss_seg], 0, bss_size);

for (spnt = sections, i = 0; i < epnt->e_shnum; ++i, ++spnt) {
#ifdef __i386__
--- 366,372 ----
}

/* JEJB: zero the bss (now it's actually allocated) */
! if (bss_size > 0) memset(secref[bss_seg], 0, bss_size);

for (spnt = sections, i = 0; i < epnt->e_shnum; ++i, ++spnt) {
#ifdef __i386__
***************
*** 622,628 ****
}

loaded = (char *)(((int)loaded + 3) & ~3);
! 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))
--- 622,630 ----
}

loaded = (char *)(((int)loaded + 3) & ~3);
! if (bss_seg != -1){
! 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))

--------------------------------------------------------
Jacques Gelinas (jacques@solucorp.qc.ca)
Linuxconf: The ultimate administration system for Linux.
see http://www.solucorp.qc.ca/linuxconf