From owner-freebsd-mips@FreeBSD.ORG Thu Feb 11 20:33:57 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BC7A1065672 for ; Thu, 11 Feb 2010 20:33:57 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-fx0-f226.google.com (mail-fx0-f226.google.com [209.85.220.226]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5948FC08 for ; Thu, 11 Feb 2010 20:33:56 +0000 (UTC) Received: by fxm26 with SMTP id 26so1736053fxm.13 for ; Thu, 11 Feb 2010 12:33:55 -0800 (PST) Received: by 10.223.100.216 with SMTP id z24mr506043fan.5.1265920434032; Thu, 11 Feb 2010 12:33:54 -0800 (PST) Received: from localhost (77-226-132-95.pool.ukrtel.net [95.132.226.77]) by mx.google.com with ESMTPS id 12sm4472224fks.9.2010.02.11.12.33.52 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Feb 2010 12:33:53 -0800 (PST) Date: Thu, 11 Feb 2010 22:33:36 +0200 From: Alex RAY To: Oleksandr Tymoshenko Message-Id: <20100211223336.650f22dd.ray@ddteam.net> In-Reply-To: <4B74550B.8020505@bluezbox.com> References: <20100211180129.b34a95c9.ray@dlink.ua> <4B74550B.8020505@bluezbox.com> Organization: DDTeam.net X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-mips@freebsd.org Subject: Re: Question about kld modules X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2010 20:33:57 -0000 On Thu, 11 Feb 2010 11:05:47 -0800 Oleksandr Tymoshenko wrote: > Alexandr Rybalko wrote: > > Someone have luck in loadable modules support on MIPS port? > > I tried to but failed. First, we have a little mess with LDFLAGS, but > you've already found it out :) : > http://lists.freebsd.org/pipermail/freebsd-arch/2009-October/009687.html > > Then there were problems with linker itself, it assumed some addresses > for relocations to be NULL and dropped these relocations while > producing final object file. Need to re-do this to recall actual > details. > I thing it`s time to update gcc or help to write MIPS support for "clang" :) When I dig about troubles with CALL16 in module make, I found what gcc have patch in 4.3.x which fix that bug. But we have 4.2.1 now. Also I can replace usage R_MIPS_REL32 with R_MIPS_32 to avoid KLD linking errors, but I thing this may by fixed with gcc/binutils update. And more recent version have support -fstack-protector on MIPS. Return to our modules. When I replace R_MIPS_REL32 with R_MIPS_32, module pass linker checking, but crash on linker_load_dependencies (kern_linker.c:2042) In first iteration of for, after `mp = *mdp;`, at this point in `mp` we have address like 0x5xxxxx (but this is badaddr(0x5xxxxx)), so at next instr (mp->md_type != MDT_VERSION) we have trap :( Who responsible about right KLD load address, kernel or ld? -- Alex RAY