From owner-freebsd-mips@FreeBSD.ORG Tue Mar 29 07:15:44 2011 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 CEE6A1065676 for ; Tue, 29 Mar 2011 07:15:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 668008FC0C for ; Tue, 29 Mar 2011 07:15:44 +0000 (UTC) Received: by wyf23 with SMTP id 23so4136287wyf.13 for ; Tue, 29 Mar 2011 00:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=oXUn2Nvt2PzbTiZVRb9kF00i9+CobqeW9LL4r0sK1Ww=; b=dnnYU+4/X8fWGy8Qer5bzhIl+Ca9+b1EdcRuT+nOAvbbTfVEq+OT5sxYaakYVSZSXO H+zf5Zm5Xq3fD1ZAckhGH0JsKwoh/aX3f71M1ePWg9/tV797H+xD8cT34EvRMMHd5a5d rUsUXJ28kyKRw0pOlH6ghzK01KiVYo2GSVVEk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rjxy+EEopWTmrlo6Nw5dtvlWkSrgtsYu8u7Xv26XQi9eFtsfTeQD2tuOpkt4llJV2b HUZsviO9wv7tXrN0tWE+OrdYaP34aiOrPaRWOu6IPSx/aii5wmK4201i3aZKB7cX0v5s 3ayfaBNnNHeNurvsq8Yv7qMY86ME5olF4uY0s= MIME-Version: 1.0 Received: by 10.227.104.2 with SMTP id m2mr4737794wbo.35.1301382943196; Tue, 29 Mar 2011 00:15:43 -0700 (PDT) Received: by 10.227.135.137 with HTTP; Tue, 29 Mar 2011 00:15:43 -0700 (PDT) Date: Tue, 29 Mar 2011 15:15:43 +0800 Message-ID: From: Adrian Chadd To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: linker weirdness for MIPS kernel? 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: Tue, 29 Mar 2011 07:15:45 -0000 Hi guys, I'm trying to use modules on my MIPS boards and I'm hitting a snag. # kldload ./wlan.ko # kldload ./ath_hal.ko # kldload ./ath_rate_sample.ko link_elf_obj: symbol ieee80211_iterate_nodes undefined (1) linker_load_file: Unsupported file type kldload: can't load ./ath_rate_sample.ko: Exec format error # nm ./wlan.ko | grep ieee80211_iterate_nodes 00015edc t ieee80211_iterate_nodes # kldstat Id Refs Address Size Name 1 7 0x80000000 80000000 kernel 2 1 0xc7b4e000 538e4 wlan.ko 3 1 0xc7ba2000 70b88 ath_hal.ko # So the wlan module is loaded, it has that symbol internally, but the linker isn't gluing them together. That (1) is a local patch of mine to figure out where it's broken - here, it's broken in link_elf_obj.c:1038 . Ie, it's the first loop in relocate_file(). I'm not up to date on how all this ELF and kernel module/linker magic works, could someone please give me a hand diagnosing why this is happening? Thanks, Adrian