From: Mike Frysinger Date: Mon, 17 Nov 2008 17:59:02 -0500 Subject: [U-Boot] weak functions versus conditional compile In-Reply-To: References: Message-ID: <200811171759.03532.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday 17 November 2008 16:17:54 Graeme Russ wrote: > I have a quick question I would like the groups opinion on: > > What is the rule-of-thumb for defining a function as weak versus using > conditional compilation (or #defines)? > > For example, I am doing some work on cleaning up the structure and design > of the i386 / sc520 code. Specifically, some functionality such as > interrupts, timers and CPU reset have more 'powerful' implementations in > the sc520. > > Should I declare these functions as weak in the core i386 code and use a > config #define to override or should I seperate the functions out into > seperate source files and use conditional compilation? i wonder if weak functions that are always satisfied and used unconditionally result in larger code, or if this is only a problem for people whose linkers lack lazy relaxation support ? -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20081117/7c8d4b92/attachment.pgp