small patch to build klogd-1.3.3 under 2.1.36

Alessandro Suardi (asuardi@uninetcom.it)
Tue, 29 Apr 1997 20:01:24 +0200


This is a multi-part message in MIME format.

--------------379E2F9063187245351652DE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

I was stuck in this scenario:

1. kernel 2.1.xx + modutils 2.1.xx
2. klogd 1.3-0 from RedHat 3.0.3
3. sysklogd-1.3-9.src.rpm which does not build under 2.1.xx
4. this in /var/log/messages:
-------------------------------------------------------------
Apr 19 11:59:56 redrose syslogd 1.3-0: restart.
Apr 19 11:59:57 redrose kernel: klogd 1.3-0, log source = /proc/kmsg started.
Apr 19 11:59:57 redrose kernel: Error in symbol table input.
Apr 19 11:59:57 redrose kernel: Cannot find map file.
-------------------------------------------------------------

I tried deleting the top two lines in System.map as someone
suggested a while ago but nothing changed. klogd -d won't
output anything at the relevant lines of code unless it's
compiled with VERBOSE_DEBUGGING (catch-22 !).

Recompiling with the patch applied (which basically looks for
'addr' in struct module_info instead of struct module) gets
--------------------------------------------------------------
Apr 29 19:19:36 redrose syslogd 1.3-3: restart.
Apr 29 19:19:37 redrose kernel: klogd 1.3-3, log source = /proc/kmsg started.
Apr 29 19:19:38 redrose kernel: Loaded 3850 symbols from /usr/src/linux/System.map.
Apr 29 19:19:38 redrose kernel: Symbols match kernel version 2.1.36.
Apr 29 19:19:38 redrose kernel: No module symbols loaded.
--------------------------------------------------------------

which would appear to work. Since I'm *very* far from having
understood what I've done, please let me know whether I've
done something dumb, or neutral, or I (whoa !) got it right.

...or, of course, if there is a newer RPM or what which builds
under 2.1.36 !

Cheers,

--alessandro <asuardi@uninetcom.it> <asuardi@it.oracle.com>

Linux-i386 kernel-2.1.36 libc-5.4.23 gcc-2.7.2.1 binutils-2.7.0.9

--------------379E2F9063187245351652DE
Content-Type: text/plain; charset=us-ascii; name="klogd-1.3.3.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="klogd-1.3.3.patch"

--- ksym_mod.c Tue Apr 29 18:16:24 1997
+++ ksym_mod.c.new Tue Apr 29 19:12:42 1997
@@ -94,6 +94,7 @@

char *name;
struct module module;
+ struct module_info module_info;
};

static int num_modules = 0;
@@ -525,8 +526,8 @@
* If it is in this range we can at least return the
* name of the module.
*/
- if ( (void *) value >= mp->module.addr &&
- (void *) value <= (mp->module.addr + \
+ if ( value >= mp->module_info.addr &&
+ value <= (mp->module_info.addr + \
mp->module.size * 4096) )
{
/*
@@ -546,7 +547,7 @@
if ( mp->num_syms > 0 )
{
last = &mp->sym_array[mp->num_syms - 1];
- sym->size = (int) mp->module.addr + \
+ sym->size = (int) mp->module_info.addr + \
(mp->module.size * 4096) - value;
sym->offset = value - last->value;
return(last->name);
@@ -558,7 +559,7 @@
* faulting address in the module.
*/
sym->size = mp->module.size * 4096;
- sym->offset = (void *) value - mp->module.addr;
+ sym->offset = value - mp->module_info.addr;
return(mp->name);
}
}

--------------379E2F9063187245351652DE--