[U-Boot-Users] "weak" reference seems not working on git://git.denx.de/u-boot-at91.git

os user gnusercn at gmail.com
Mon Jul 28 05:52:34 CEST 2008


Hi folks,
I use Atmel AT91SAM9260-EK boards, arm-linux-gcc (GCC) 4.2.4. After I
pulled the latest code from git://git.denx.de/u-boot-at91.git, I found
that the "weak" function seems not working.

In lib_arm/board.c, we can see,
void inline __coloured_LED_init (void) {}

void inline coloured_LED_init (void) __attribute__((weak,
alias("__coloured_LED_init")));

And then I defined my own version in board/atmel/at91sam9260ek/led.c,
void coloured_LED_init(void)
{
    //.. do someting...
}

After 1)make at91sam9260ek_config and 2) make 3) download the
u-boot.bin to dataflash 4) reseting the board, I found that my version
of coloured_LED_init never gets called. Could anyone please explain
the trick behind?

BTW, If I comment out the declaration in lib_arm/board.c, my version
of coloured_LED_init can get called.

Thanks.




More information about the U-Boot mailing list