Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262943AbVCDTVy (ORCPT ); Fri, 4 Mar 2005 14:21:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263026AbVCDTSG (ORCPT ); Fri, 4 Mar 2005 14:18:06 -0500 Received: from chaos.sr.unh.edu ([132.177.249.105]:59619 "EHLO chaos.sr.unh.edu") by vger.kernel.org with ESMTP id S263004AbVCDTMk (ORCPT ); Fri, 4 Mar 2005 14:12:40 -0500 Date: Fri, 4 Mar 2005 14:11:13 -0500 (EST) From: Kai Germaschewski X-X-Sender: kai@chaos.sr.unh.edu To: Rusty Russell cc: Adrian Bunk , Andrew Morton , , Sam Ravnborg , Vincent Vanackere , , lkml - Kernel Mailing List Subject: Re: Undefined symbols in 2.6.11-rc5-mm1 In-Reply-To: <1109931797.28203.2.camel@localhost.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1287 Lines: 31 On Fri, 4 Mar 2005, Rusty Russell wrote: > On Wed, 2005-03-02 at 15:00 +0100, Adrian Bunk wrote: > > Why doesn't an EXPORT_SYMBOL create a reference? > > It does: EXPORT_SYMBOL(x) drops the address of "x", including > __attribute_used__, in the __ksymtab section. Well, the problem is that this is still an internal reference in the same object file. So ld looks into the lib .a archive, determines that none of the symbols in that object file are needed to resolve a reference and drops the entire .o file. Doing so, it drops the __ksymtab section as well, which otherwise would be used by the kernel to look up that symbol. So it drops the reference and the referencee ;), which is normally fine -- no unresolved symbols occur. Unfortunately, the kernel really needs to know the contents of the __ksymtab sections to correctly export those symbols, but it doesn't reference it in any explicit way. I don't think there's an easy fix, except for not putting such objects into an archive/lib, but to link them directly. --Kai - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/