[U-Boot] [PATCH] JFFS2: Fix undefined reference to `__aeabi_uldivmod' error
Daniel Schwierzeck
daniel.schwierzeck at gmail.com
Sun Oct 27 19:17:52 CET 2013
2013/10/27 Wolfgang Denk <wd at denx.de>:
> Building boards that have JFFS2 support enabled will fail when using
> U-Boot's builtin GCC library, for example like this:
>
> USE_PRIVATE_LIBGCC=yes ./MAKEALL omap3_evm
> ...
> fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists':
> fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'
I recently noticed a similar problem on MIPS too:
fs/jffs2/libjffs2.o: In function `jffs2_get_list':
jffs2_1pass.c:(.text.jffs2_get_list+0x5c): undefined reference to `__udivdi3'
Your patch solves it, thanks.
Tested-by: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
>
> This is caused by a u64 / u32 division in jffs2_1pass.c; the problem
> can be avoided by using do_div() instead of plain division.
>
> Signed-off-by: Wolfgang Denk <wd at denx.de>
> Reported-by: Chris Ruehl <chris.ruehl at gtsys.com.hk>
> Cc: Chris Ruehl <chris.ruehl at gtsys.com.hk>
>
> ---
> fs/jffs2/jffs2_1pass.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
> index c856983..a7dbe79 100644
> --- a/fs/jffs2/jffs2_1pass.c
> +++ b/fs/jffs2/jffs2_1pass.c
> @@ -1438,7 +1438,7 @@ jffs2_1pass_build_lists(struct part_info * part)
> {
> struct b_lists *pL;
> struct jffs2_unknown_node *node;
> - u32 nr_sectors = part->size/part->sector_size;
> + u32 nr_sectors = do_div(part->size, part->sector_size);
> u32 i;
> u32 counter4 = 0;
> u32 counterF = 0;
> --
> 1.8.3.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
--
Best regards,
Daniel
More information about the U-Boot
mailing list