[Replying to a sort of related message, since I've already deleted the original commit mail]
On Mon, Mar 15, 2010 at 22:44:11 +0900, Izumi Tsutsui wrote: > > > I've tested with an i386 kernel. I'd rather not make those changes > > > conditional so I'll see if I can work out why the Atari kernel would > > > have problems. If no CTF section is found then ksyms should behave > > > exactly as it did before the change, just with an empty CTF section. > > > > Ok, I'll check what happens on initialization, > > but should it work even with old bootloaders? > > It looks more sanity checks are required in ksyms_addsyms_elf(). > > --- > #ifdef KDTRACE_HOOKS > /* Find the CTF section */ > shdr = (Elf_Shdr *)((uint8_t *)start + ehdr->e_shoff); > if (ehdr->e_shstrndx != 0) { > char *shstr = (uint8_t*)start + > shdr[ehdr->e_shstrndx].sh_offset; > for (i = 1; i < ehdr->e_shnum; i++) { > if (shdr[i].sh_type != SHT_PROGBITS) > continue; > if (strncmp(".SUNW_ctf", &shstr[shdr[i].sh_name] ,10) > != 0) > continue; > --- > > My atari kernel hangs in this strncmp(). > shstr is 0x4c60f4 and it looks invalid because > kernel end is 0x277d48 and shdr is 0x277d7c. > > (BTW, please also use KNF properly) BTW, a counterpart strncmp(".SUNW_ctf", ...) in libsa broke at least http://releng.netbsd.org/builds/HEAD/201003140000Z/mvme68k.build.failed http://releng.netbsd.org/builds/HEAD/201003140000Z/mvmeppc.build.failed with loadfile_elf32.c:(.text+0x...): undefined reference to `strncmp' I guess you need to add strncmp.c to SRCS (see libsa/Makefile:35) It's also suspicious that the same check is not in loadfile_elf64.c SY, Uwe -- u...@stderr.spb.ru | Zu Grunde kommen http://snark.ptc.spbu.ru/~uwe/ | Ist zu Grunde gehen