[U-Boot] Weak symbols: request for comments

Sebastien Carlier sebastien.carlier at gmail.com
Fri Nov 5 13:57:39 CET 2010


Dear Wolfgang,

On 11/05/2010 01:23 PM, Wolfgang Denk wrote:
> Dear Sebastien Carlier,
>
> In message<4CD3F58F.8090302 at gmail.com>  you wrote:
>    
>> It does seem like weak symbols were designed with other uses in mind,
>> such as C++ class members defined within a class declaration, or to weak
>> the dependencies between libraries... but not really to allow
>> overridable definitions (what if two objects want to override the same
>> weak symbol in different ways?).
>>      
> Well, but that's exactly why they are used in library code: to allow
> overridable definitions.
>    

If this usage were specifically designed for, do you think the linker 
would silently allow multiple yet conflicting weak definitions for the 
same symbol?  It is true that weak symbols can be used to support 
overridable definitions, but they seem more suitable for other uses.

Regards,

Sebastien Carlier



More information about the U-Boot mailing list