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.