Date: Tue, 10 Aug 2010 08:28:31 +0200 From: Stefan Farfeleder <stefanf@FreeBSD.org> To: Neel Natu <neel@FreeBSD.org> 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 Message-ID: <20100810062829.GA1737@mole.fafoe.narf.at> In-Reply-To: <201008100515.o7A5FZZF017552@svn.freebsd.org> References: <201008100515.o7A5FZZF017552@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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) >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100810062829.GA1737>