[Top] [All Lists]

Re: OProfile cannot be loaded as module...

To: Ralf Baechle <>
Subject: Re: OProfile cannot be loaded as module...
From: David Daney <>
Date: Tue, 18 Oct 2005 08:46:20 -0700
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <>
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?


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>