From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shinya Kuribayashi Date: Thu, 25 Dec 2008 01:55:05 +0900 Subject: [U-Boot] [RFC][PATCH] Code Clean-up (weak functions) In-Reply-To: <005501c965d1$a95ceee0$fc16cca0$@Tjernlund@transmode.se> References: <1229145986-9936-1-git-send-email-graeme.russ@gmail.com> <49518CF0.2040903@necel.com> <005501c965d1$a95ceee0$fc16cca0$@Tjernlund@transmode.se> Message-ID: <49526969.5000402@ruby.dti.ne.jp> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Joakim Tjernlund wrote: >>> - There is no purely weak functions and therfore no longer code like: >>> if (do_something) >>> do_somthing(); >>> All instances have been replaced by empty functions with an alias. e.g. >>> void __do_something (args) {} >>> do_something(args) __atttribute__((weak, alias("__do_something"))); > > Curious as to why you removed such code? Was it because it didn't work? If > so I might have an answer for that. See my post: > "Re: [U-Boot] [PATCH V4] cmd_bdinfo: move implementation to arch instead of common" > > Jocke Good to know. This doc also helps: http://docs.sun.com/app/docs/doc/817-1984/chapter2-11?l=en&a=view Then, - we must try to not leave undefined weak symbols at all, - or check the symbol before invocation for the safety in case of NULL dereference.