From owner-svn-src-all@FreeBSD.ORG Tue Aug 10 07:25:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 876C01065686; Tue, 10 Aug 2010 07:25:40 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 992008FC1E; Tue, 10 Aug 2010 07:25:39 +0000 (UTC) Received: by wyj26 with SMTP id 26so13574749wyj.13 for ; Tue, 10 Aug 2010 00:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=C9OsgvaGTa9tZd0iFspvFBFfKes4x5PhkacLa1AAitw=; b=M5qwQFYH2m7dCwHp5VgxcLgkgC3smsUFXH8C57sHP+oHTVEPhDjw4IsgZZL4hUygzC 8YlKaZj9jy8djW01vLtM9jvoGoCWX8jSTymBVH0UDPdiqW5aGDin9OeohxM77B8+D4Pr DUjk6kOpyzTXM0arXgrpyRRyBV7XRW0Z8Ix1Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ak9tOVF14qKhrj7Pdj5mLiAtfGqZlKlE8RDCZWDRbiqwfb+g1Xky0gkkgWibB2RzU1 8QYvvAw14tyUo0sjbQ0Bx6NJWAUg7TshLF89QGq5h3d+FKVu8Y3UJMdNbvFqotoOUYpp LtqNvtVspY9dlb3VMcbNuqUUz6VYq6BmKTLnQ= MIME-Version: 1.0 Received: by 10.216.11.66 with SMTP id 44mr14759413wew.69.1281425138443; Tue, 10 Aug 2010 00:25:38 -0700 (PDT) Received: by 10.216.160.10 with HTTP; Tue, 10 Aug 2010 00:25:38 -0700 (PDT) In-Reply-To: References: <201008100515.o7A5FZZF017552@svn.freebsd.org> <20100810062829.GA1737@mole.fafoe.narf.at> Date: Tue, 10 Aug 2010 12:55:38 +0530 Message-ID: From: "Jayachandran C." To: Neel Natu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder , src-committers@freebsd.org Subject: Re: svn commit: r211130 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 07:25:40 -0000 On Tue, Aug 10, 2010 at 12:12 PM, Neel Natu wrote: > Hi Stefan, > > On Mon, Aug 9, 2010 at 11:28 PM, Stefan Farfeleder = wrote: >> On Tue, Aug 10, 2010 at 05:15:35AM +0000, Neel Natu wrote: >>> Author: neel >>> Date: Tue Aug 10 05:15:35 2010 >>> New Revision: 211130 >>> URL: http://svn.freebsd.org/changeset/base/211130 >>> >>> Log: >>> =A0 Fix compilation error for 64-bit little endian build: >>> =A0 libexec/rtld-elf/mips/reloc.c:196: warning: right shift count >=3D = width of type >>> >>> =A0 When the expression '(r_info) >> 32' was passed to bswap32() it was= promptly >>> =A0 changed to '(uint32_t)(r_info) >> 32' which is not what we intended= . >> >> Wouldn't it be better to fix the bswap32 macro instead? >> > > I think you are right. Can you take a look at the following patch instead= ? > > If I hear no objections, I will commit it tomorrow. > > Index: libexec/rtld-elf/mips/reloc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- libexec/rtld-elf/mips/reloc.c =A0 =A0 =A0 (revision 211131) > +++ libexec/rtld-elf/mips/reloc.c =A0 =A0 =A0 (working copy) > @@ -83,7 +83,7 @@ > =A0#undef ELF_R_SYM > =A0#undef ELF_R_TYPE > =A0#define ELF_R_SYM(r_info) =A0 =A0 =A0 =A0 =A0 =A0 =A0((r_info) & 0xfff= fffff) > -#define ELF_R_TYPE(r_info) =A0 =A0 =A0 =A0 =A0 =A0 bswap32(((r_info) >> = 32)) > +#define ELF_R_TYPE(r_info) =A0 =A0 =A0 =A0 =A0 =A0 bswap32((r_info) >> 3= 2) > =A0#endif > =A0#else > =A0#define =A0 =A0 =A0 =A0ELF_R_NXTTYPE_64_P(r_type) =A0 =A0 =A0(0) > Index: sys/sys/endian.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/sys/endian.h =A0 =A0(revision 211131) > +++ sys/sys/endian.h =A0 =A0(working copy) > @@ -56,9 +56,9 @@ > =A0/* > =A0* General byte order swapping functions. > =A0*/ > -#define =A0 =A0 =A0 =A0bswap16(x) =A0 =A0 =A0__bswap16(x) > -#define =A0 =A0 =A0 =A0bswap32(x) =A0 =A0 =A0__bswap32(x) > -#define =A0 =A0 =A0 =A0bswap64(x) =A0 =A0 =A0__bswap64(x) > +#define =A0 =A0 =A0 =A0bswap16(x) =A0 =A0 =A0__bswap16((x)) > +#define =A0 =A0 =A0 =A0bswap32(x) =A0 =A0 =A0__bswap32((x)) > +#define =A0 =A0 =A0 =A0bswap64(x) =A0 =A0 =A0__bswap64((x)) > I think there is a problem in sys/mips/include/_endian.h -- #define __bswap16(x) (__uint16_t)(__is_constant(x) ? \ __bswap16_const((__uint16_t)x) : __bswap16_var((__uint16_t)x)) #define __bswap32(x) (__uint32_t)(__is_constant(x) ? \ __bswap32_const((__uint32_t)x) : __bswap32_var((__uint32_t)x)) #define __bswap64(x) (__uint64_t)(__is_constant(x) ? \ __bswap64_const((__uint64_t)x) : __bswap64_var((__uint64_t)x)) -- I'm not sure why the cast is needed, but we should have a braces around x, unless I'm completely mistaken. JC.