linux-mips
[Top] [All Lists]

Re: OProfile cannot be loaded as module...

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: OProfile cannot be loaded as module...
From: David Daney <ddaney@avtrex.com>
Date: Tue, 18 Oct 2005 08:46:20 -0700
Cc: linux-mips@linux-mips.org
In-reply-to: <20051018110355.GB2656@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <43470BCF.1070709@avtrex.com> <20051013225520.GA3234@linux-mips.org> <43540609.4000105@avtrex.com> <20051018110355.GB2656@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)
Ralf Baechle wrote:
On Mon, Oct 17, 2005 at 01:14:01PM -0700, David Daney wrote:

Fine, but what exactly are the semantics of __attribute__((weak)) in modules? It gets resolved when linking with other objects that make up the module. But what if the weak symbol can be resolved at module load time against symbols in either the kernel proper or other modules?


Yes.


What happens if the weak symbol can be resolved by a symbol in a module
that is loaded after the one with the weak symbol?  Does it get fixed up
when the new module is loaded?


No, it won't - and I don't think that would be a good idea.  The potencial
for bugs is just too large.


Given your 'yes' and 'no' answers, the behavior of a module could depend on the order in which the modules are loaded, as they can be linked differently depending on which modules are already present.

That doesn't seem like a good way of doing things.

If if were up to me (and I know that it is not), I would disallow linking of weak symbols at module load time altogether.

David Daney.

<Prev in Thread] Current Thread [Next in Thread>