public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michael Roth <mroth@nessie.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] Allow board specific overwriting of library code
Date: Wed, 04 Feb 2009 17:18:16 +0100	[thread overview]
Message-ID: <4989BFC8.6030204@nessie.de> (raw)
In-Reply-To: <4989BB8E.9090405@nessie.de>

Michael Roth schrieb:

> Because the whole weak-linking looks like it is somewhat broken or at
> least very difficult to get it correctly.

Small example:

In board/atmel/at91sam9261ek there is:

led.c:
	void red_LED_on(void)
	...
	void red_LED_off(void)
	...

Makefile:

	COBJS-y += led.o
	...
	OBJS    := $(addprefix $(obj),$(COBJS-y))
	...
	$(LIB): $(obj).depend $(OBJS) $(SOBJS)


And in lib_arm/board.c we have:

	void inline __red_LED_on (void) {}
	void inline red_LED_on (void) __attribute__((weak, alias("__red_LED_on")));
	void inline __red_LED_off(void) {}
	void inline red_LED_off(void)        __attribute__((weak, alias("__red_LED_off")));


But as you can see from u-boot.map, the result is not as expected:

	0x23f00340      0x35c lib_arm/libarm.a(board.o)
	0x23f00390                __red_LED_off
	...
	0x23f00390                red_LED_off
	...
	0x23f0038c                red_LED_on
	0x23f0038c                __red_LED_on


No single weak symbol from lib_arm/board.c get overridden from the
board specific led.c. Very annoying.


Michael Roth

  parent reply	other threads:[~2009-02-04 16:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 14:29 [U-Boot] [PATCH 0/2] Initial Stamp9261 board support Michael Roth
2009-02-04 14:29 ` [U-Boot] [PATCH 1/2] Allow board specific overwriting of library code Michael Roth
2009-02-04 14:29   ` [U-Boot] [PATCH 2/2] Stamp9261 board support Michael Roth
2009-02-04 16:05     ` Wolfgang Denk
2009-02-05 14:07       ` Michael Roth
2009-02-04 14:48   ` [U-Boot] [PATCH 1/2] Allow board specific overwriting of library code Jerry Van Baren
2009-02-04 15:36   ` Wolfgang Denk
2009-02-04 16:00     ` Michael Roth
2009-02-04 16:08       ` Wolfgang Denk
2009-02-04 16:18       ` Michael Roth [this message]
2009-02-04 16:23         ` Mike Frysinger
2009-02-04 21:12         ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4989BFC8.6030204@nessie.de \
    --to=mroth@nessie.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox