summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-12-28 19:55:44 +0000
committerdim <dim@FreeBSD.org>2014-12-28 19:55:44 +0000
commit87579a607c79f048f7e90b7913f2db29f4ebaff4 (patch)
tree67e78b2a7f761faffbf05383bac55b1ee586b799 /libexec
parent1fcfd71f4d7d619c2e71e5cc7d32ad1cf5ba509d (diff)
downloadFreeBSD-src-87579a607c79f048f7e90b7913f2db29f4ebaff4.zip
FreeBSD-src-87579a607c79f048f7e90b7913f2db29f4ebaff4.tar.gz
Fix the following -Werror warning from clang 3.5.0, while building
rtld-elf for powerpc 32 bit: libexec/rtld-elf/powerpc/reloc.c:486:6: error: taking the absolute value of unsigned type 'Elf_Addr' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value] if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^ libexec/rtld-elf/powerpc/reloc.c:486:6: note: remove the call to 'abs' since unsigned values cannot be negative if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^~~ 1 error generated. Cast 'offset' to int, since that was intended, and should be safe to do on architectures with 32-bit two's complement ints. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D1387
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/powerpc/reloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c
index 89e5536..8e23daa 100644
--- a/libexec/rtld-elf/powerpc/reloc.c
+++ b/libexec/rtld-elf/powerpc/reloc.c
@@ -483,7 +483,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj,
*/
offset = target - (Elf_Addr)wherep;
- if (abs(offset) < 32*1024*1024) { /* inside 32MB? */
+ if (abs((int)offset) < 32*1024*1024) { /* inside 32MB? */
/* b value # branch directly */
*wherep = 0x48000000 | (offset & 0x03fffffc);
__syncicache(wherep, 4);
OpenPOWER on IntegriCloud