From patchwork Sun Oct 27 09:14:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Denk X-Patchwork-Id: 286328 X-Patchwork-Delegate: wd@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8B43F2C011F for ; Sun, 27 Oct 2013 20:14:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AC63A4A16D; Sun, 27 Oct 2013 10:14:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xUXyZEXOW74e; Sun, 27 Oct 2013 10:14:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D17F74A16E; Sun, 27 Oct 2013 10:14:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 71D384A16E for ; Sun, 27 Oct 2013 10:14:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nky1gftbHtYK for ; Sun, 27 Oct 2013 10:14:39 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by theia.denx.de (Postfix) with ESMTPS id 20D8B4A16D for ; Sun, 27 Oct 2013 10:14:32 +0100 (CET) Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3d6tfs2Z5vz3hhbp; Sun, 27 Oct 2013 10:14:27 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3d6tfq3TBtzbbhp; Sun, 27 Oct 2013 10:14:27 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from smtp-auth.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id IfvZtRGtLlH1; Sun, 27 Oct 2013 10:14:26 +0100 (CET) X-Auth-Info: AIRshVC7rIcLirm6/ibNiO4iARRNZKNKYpU7cpSquJ4= Received: from diddl.denx.de (host-80-81-18-216.customer.m-online.net [80.81.18.216]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA; Sun, 27 Oct 2013 10:14:26 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.0.0.2]) by diddl.denx.de (Postfix) with ESMTP id E0C3A1A4FA3; Sun, 27 Oct 2013 10:14:25 +0100 (CET) Received: by gemini.denx.de (Postfix, from userid 500) id E0F453811E0; Sun, 27 Oct 2013 10:14:24 +0100 (MET) From: Wolfgang Denk To: u-boot@lists.denx.de Date: Sun, 27 Oct 2013 10:14:11 +0100 Message-Id: <1382865251-17302-1-git-send-email-wd@denx.de> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52671A0A.3020907@gtsys.com.hk> References: <52671A0A.3020907@gtsys.com.hk> Cc: Tom Rini Subject: [U-Boot] [PATCH] JFFS2: Fix undefined reference to `__aeabi_uldivmod' error X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.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' 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 Reported-by: Chris Ruehl Cc: Chris Ruehl Tested-by: Daniel Schwierzeck --- 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;