From patchwork Mon May 13 07:45:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 243316 X-Patchwork-Delegate: albert.aribaud@free.fr 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 C6FC42C0095 for ; Mon, 13 May 2013 17:45:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A05BA4A027; Mon, 13 May 2013 09:45:33 +0200 (CEST) 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 et8Scb7ZAKhH; Mon, 13 May 2013 09:45:33 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 406214A01F; Mon, 13 May 2013 09:45:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 294EB4A01F for ; Mon, 13 May 2013 09:45:28 +0200 (CEST) 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 nmm68MQTVCSH for ; Mon, 13 May 2013 09:45:22 +0200 (CEST) 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-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) by theia.denx.de (Postfix) with ESMTPS id 90D804A01E for ; Mon, 13 May 2013 09:45:15 +0200 (CEST) Received: by mail-ea0-f179.google.com with SMTP id h14so3370692eaj.10 for ; Mon, 13 May 2013 00:45:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=FPOccr9tiSpjwcO53Ne6JLROtU/FJRUQUEI6FuwhMXc=; b=TTCl/WD1scghctYlWLhzy+BqXRlcIwgycEIIS1fzs5njhkIyDrxYpXcV7qYgoHk9ti YyAlIZww3DOVpEXAajdyQvjDoAlV8966JzCK78S0rKSdO7Q6ou51EVgZf/hAxxnio3NB ILe+QilUGVdYzPFw+nFD7/PZPJ9ZX+ZY3MCBn30qk9mCoS0IzA9J8MTVkGrp7lyMSpyv hU+U+t7h3T0eKqrD6jISNLQ6Mc/k5BWImKse71jm2pdi7r6q3r8vWmMpNy6z1/6sg28N Q0jiGjOAb4g7Vl0gZf1rv700UUWVXoQElJdv+XqG4N+mp+X82s/HTGLIpSuBbN0dIZZ9 EuwQ== X-Received: by 10.14.3.4 with SMTP id 4mr16783806eeg.8.1368431113918; Mon, 13 May 2013 00:45:13 -0700 (PDT) Received: from [192.168.0.100] (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id t9sm21043567eeo.11.2013.05.13.00.45.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 00:45:13 -0700 (PDT) Message-ID: <51909A08.2080200@monstr.eu> Date: Mon, 13 May 2013 09:45:12 +0200 From: Michal Simek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 MIME-Version: 1.0 To: Albert ARIBAUD References: <40cc0ff325a279f7fe2a51e5a91aa24adcbad373.1368092129.git.michal.simek@xilinx.com> <20130510210736.22170c33@lilith> In-Reply-To: <20130510210736.22170c33@lilith> X-Enigmail-Version: 1.5.1 X-Gm-Message-State: ALoCoQldOTPE64kabHDsfGsT+8m9eSUdF0AF1VWXHH5rwTz+vMtCK2TjR8PKFofI+TIKok+5TzY1 Cc: "Edgar E. Iglesias" , Peter Crosthwaite , Michal Simek , Jagannadha Sutradharudu Teki , u-boot@lists.denx.de, Tom Rini Subject: Re: [U-Boot] [RFC PATCH] arm: lds: Remove libgcc eabi exception handling tables X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list Reply-To: monstr@monstr.eu List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On 05/10/2013 09:07 PM, Albert ARIBAUD wrote: > Hi Michal, > > On Thu, 9 May 2013 11:35:33 +0200, Michal Simek > wrote: > >> Remove ARM eabi exception handling tables (for frame unwinding). >> AFAICT, u-boot stubs away the frame unwiding routines, so the tables will >> more or less just consume space. It should be OK to remove them. >> >> Signed-off-by: Edgar E. Iglesias >> Signed-off-by: Michal Simek >> --- >> Other options could be to complete u-boot/arch/arm/lib/* so that >> libgcc routines with exception handling dont get pulled in. Or >> to avoid user code (like the mentioned patch) which causes external >> libgcc functions to get pulled in... > > Er... which mentioned patch? Ah yeah. Let me give you background. After adding: "arm: zynq: U-Boot udelay < 1000 FIX" (sha1: d54cc007878697a92e7f696b71a3eb203c0386e2) we have found that new program header is added to u-boot for zynq. Program Header: 0x70000001 off 0x000405fc vaddr 0x040385fc paddr 0x040385fc align 2**2 filesz 0x00000020 memsz 0x00000020 flags r-- LOAD off 0x00008000 vaddr 0x04000000 paddr 0x04000000 align 2**15 filesz 0x00041240 memsz 0x00041240 flags rwx STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2 filesz 0x00000000 memsz 0x00000000 flags rwx Tracing down this we found that uldivmod is used 27: 00000000 0 NOTYPE GLOBAL DEFAULT UND __aeabi_uldivmod Based on that Edgar proposed this patch. After my experiment we can also use the patch below to fix it because external libgcc functions are not pulled it. But probably removing that ARM eabi exception handling tables is better solution then try to change code not to use it. But for me it is no problem to send the patch below to fix this problem. Thanks, Michal diff --git a/arch/arm/cpu/armv7/zynq/timer.c b/arch/arm/cpu/armv7/zynq/timer.c index 1b56373..4b26e96 100644 --- a/arch/arm/cpu/armv7/zynq/timer.c +++ b/arch/arm/cpu/armv7/zynq/timer.c @@ -118,12 +118,13 @@ void __udelay(unsigned long usec) u32 timeend; u32 timediff; u32 timenow; + u64 temp; if (usec == 0) return; - countticks = (u32) (((unsigned long long) TIMER_TICK_HZ * usec) / - 1000000); + temp = (TIMER_TICK_HZ * usec) / 1000000; + countticks = (u32)temp; /* decrementing timer */ timeend = readl(&timer_base->counter) - countticks;