From owner-svn-src-all@FreeBSD.ORG Tue Aug 10 06:28:37 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 726F7106564A; Tue, 10 Aug 2010 06:28:37 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep18.mx.upcmail.net (fep18.mx.upcmail.net [62.179.121.38]) by mx1.freebsd.org (Postfix) with ESMTP id 50A818FC17; Tue, 10 Aug 2010 06:28:35 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep18-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100810062834.WLIK4042.viefep18-int.chello.at@edge03.upcmail.net>; Tue, 10 Aug 2010 08:28:34 +0200 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge03.upcmail.net with edge id sWUX1e03L0a5KZh03WUYBP; Tue, 10 Aug 2010 08:28:34 +0200 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 5E0E66D438; Tue, 10 Aug 2010 08:28:31 +0200 (CEST) Date: Tue, 10 Aug 2010 08:28:31 +0200 From: Stefan Farfeleder To: Neel Natu Message-ID: <20100810062829.GA1737@mole.fafoe.narf.at> References: <201008100515.o7A5FZZF017552@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008100515.o7A5FZZF017552@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Cloudmark-Analysis: v=1.1 cv=kR1739jI04gsLPPBAx/k25XPeS1fzQof9TaPDYrpM2k= c=1 sm=0 a=HLCT0tXVX6QA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8VKu2-S4YUhlNfZXeBEA:9 a=BVc4UUCRujlZn956GWcA:7 a=8d7s1U-nxetXpKDanSHeDjrg9GEA:4 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, 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 06:28:37 -0000 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: > Fix compilation error for 64-bit little endian build: > libexec/rtld-elf/mips/reloc.c:196: warning: right shift count >= width of type > > When the expression '(r_info) >> 32' was passed to bswap32() it was promptly > changed to '(uint32_t)(r_info) >> 32' which is not what we intended. Wouldn't it be better to fix the bswap32 macro instead? > Modified: > head/libexec/rtld-elf/mips/reloc.c > > Modified: head/libexec/rtld-elf/mips/reloc.c > ============================================================================== > --- head/libexec/rtld-elf/mips/reloc.c Mon Aug 9 23:32:37 2010 (r211129) > +++ head/libexec/rtld-elf/mips/reloc.c Tue Aug 10 05:15:35 2010 (r211130) > @@ -75,7 +75,7 @@ void _rtld_relocate_nonplt_self(Elf_Dyn > * ELF64 MIPS encodes the relocs uniquely. The first 32-bits of info contain > * the symbol index. The top 32-bits contain three relocation types encoded > * in big-endian integer with first relocation in LSB. This means for little > - * endian we have to byte swap that interger (r_type). > + * endian we have to byte swap that integer (r_type). > */ > #define Elf_Sxword Elf64_Sxword > #define ELF_R_NXTTYPE_64_P(r_type) ((((r_type) >> 8) & 0xff) == R_TYPE(64)) > @@ -83,7 +83,7 @@ void _rtld_relocate_nonplt_self(Elf_Dyn > #undef ELF_R_SYM > #undef ELF_R_TYPE > #define ELF_R_SYM(r_info) ((r_info) & 0xffffffff) > -#define ELF_R_TYPE(r_info) bswap32((r_info) >> 32) > +#define ELF_R_TYPE(r_info) bswap32(((r_info) >> 32)) > #endif > #else > #define ELF_R_NXTTYPE_64_P(r_type) (0) >