From patchwork Mon Aug 13 09:02:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 176885 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 A69EA2C007C for ; Mon, 13 Aug 2012 19:02:21 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 05767280AF; Mon, 13 Aug 2012 11:02:20 +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 4Oxs1GMy1qXW; Mon, 13 Aug 2012 11:02:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F2F8D280A9; Mon, 13 Aug 2012 11:02:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA554280A9 for ; Mon, 13 Aug 2012 11:02:15 +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 0iUW6GnzWK7E for ; Mon, 13 Aug 2012 11:02:15 +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-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by theia.denx.de (Postfix) with ESMTPS id 2BA12280A7 for ; Mon, 13 Aug 2012 11:02:14 +0200 (CEST) Received: by eekb45 with SMTP id b45so857464eek.3 for ; Mon, 13 Aug 2012 02:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=PIxq3HKgY2RATIWjDPVety0SGezQKA5wOEMrDc5O59g=; b=orkc80M0nIEKb5tqedmXgetY8iQvCdXYIMafca+DCCmdhuKuXQ0ctFrTYCqXLghAvD f7tbRhBOCoZZo8iljKyCJr//zvIBA7HUaEbQmcpkj5fnCxOBaD8etLl7kuZpyxJRkMdt vgUgXZ9AghNZ1y8/lEGXazVjNr+AvqcxXbRqoalEkQEEbikpnx6MPrKa8VRpMSSM/QVw rE6T1Z/Q2RhwYOoLxDmox613BCpSBEnFUn37In5DdagSsNvPmrFB2XPQiTjosLv1nHDQ eByZ5GQz7BQl3HALVEeGiwOOZBlL/Mb7YgbjhS3pbD0FQibpoGKVy3vDpReMBEB9j+Fv Otyw== Received: by 10.14.178.197 with SMTP id f45mr5988771eem.11.1344848534053; Mon, 13 Aug 2012 02:02:14 -0700 (PDT) Received: from localhost ([2a01:198:47b:1:210:75ff:fe1a:cd1e]) by mx.google.com with ESMTPS id u8sm17081694eel.11.2012.08.13.02.02.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Aug 2012 02:02:13 -0700 (PDT) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: u-boot@lists.denx.de Date: Mon, 13 Aug 2012 11:02:03 +0200 Message-Id: <1344848523-20359-1-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Cc: Shinya Kuribayashi , Macpaul Lin , Jason Jin , =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Subject: [U-Boot] [PATCH] dlmalloc: remove manual reloc alias warning 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Andreas Bießmann The avr32 architecture (and some others) require manual relocation. Due to the previous error all avr32 boards gave warnings in MAKEALL wich makes it hard to find new warnings. This patch fixes following warning: ---8<--- dlmalloc.c: In function 'malloc_bin_reloc': dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules dlmalloc.c:1490: note: initialized from here dlmalloc.c:1493: note: initialized from here --->8--- Signed-off-by: Andreas Bießmann --- A question to all the other related arches, namely m68k, mips, nds32 and sparc: Do you encounter the same warnings or is this warning due to my outdated compiler (4.4.3 currently, unfortunately atmel do not bother to send their patches mainline)? common/dlmalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/dlmalloc.c b/common/dlmalloc.c index c645d73..78b1885 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -1485,9 +1485,10 @@ static mbinptr av_[NAV * 2 + 2] = { }; #ifdef CONFIG_NEEDS_MANUAL_RELOC +typedef unsigned long __attribute__((__may_alias__)) ulong_aliased; void malloc_bin_reloc (void) { - unsigned long *p = (unsigned long *)(&av_[2]); + ulong_aliased *p = (ulong_aliased *)(&av_[2]); int i; for (i=2; i<(sizeof(av_)/sizeof(mbinptr)); ++i) { *p++ += gd->reloc_off;