[U-Boot] Weak symbols: request for comments

Wolfgang Denk wd at denx.de
Fri Nov 5 13:23:36 CET 2010


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.

> > Yes. The old-fashioned #define CONFIG_BOARD_INIT_F and friends
> > method. I would prefer that one. Its not beautiful but still
> > widely used and bullet-proof.
> 
> Could you please elaborate?  I have looked for things like this in the 
> code base but I could not find what you are referring to.

Don't bother looking for it. We are happy that we have eliminated a
bit of the #ifdef mess. We will not add it again.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I had the rare misfortune of being one of the first people to try and
implement a PL/1 compiler.                             -- T. Cheatham


More information about the U-Boot mailing list