[U-Boot-Users] multiple definition of __udivsi3 when using divide operation on unsigned long numbers

Gururaja Hebbar K R gururajakr at sanyo.co.in
Tue Mar 25 08:13:46 CET 2008


Hi  Dirk,

Thanks for the information. i looked at he  nand_util.c and used the
same do_div in my code and was able to compile without any issues.

Regards
Gururaja


> Don't do this. Compiler/Linker then tries to use math from libraries
coming with your tool chain. Normally, U-Boot should be completely
independent of any external libraries.
> 
> Option is to modify your code that compiler/linker doesn't need
external libraries:
> 
> - Try to use shift operation instead of div. E.g. "c = c >> x"
> 
> - If this doesn't work, have a look to U-Boot's lib_arm directory and
use only math available there. E.g (nand_util.c): do_div(n,
opts->length);
> 
> Cheers
> 
> Dirk




More information about the U-Boot mailing list