[U-Boot-Users] Can't get strong symbol to override weak one

Ben Warren biggerbadderben at gmail.com
Wed Jun 11 07:55:48 CEST 2008


Hi,

Not specifically U-boot related, but hopefully a smart person here can help.

I have a weak symbol defined as:
int cpu_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init")));  (1)

I've created a new file in cpu/mpc83xx that includes a real
implementation of the function:
int cpu_eth_init(bd_t *bis)  (2)

Using objdump, I've verified that this function is making it into
libmpc8xxx.a, however it doesn't get linked into the final U-boot
executable.  System.map shows cpu_eth_init at the same address as
__def_eth_init.

If I change (1) to:
extern int cpu_eth_init(bd_t *bis), (2) gets linked in OK.  Of course,
that's not what I want to do.

I've tried changing the order of the archives that get linked together
by ld, but nothing seems to work.  Since I don't really know what I'm
doing, I guess that shouldn't be surprising.

Any help would be appreciated.

thanks,
Ben




More information about the U-Boot mailing list