summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/c6x/bits/elf-dsbt.h
diff options
context:
space:
mode:
authorRahul Bedarkar <rahul.bedarkar@imgtec.com>2016-09-18 13:15:38 +0530
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-09-19 18:16:52 +0200
commit2c242092372e9f7f62b881e81e8e798475e0cbb3 (patch)
tree33a26d8f06318f55a0d0bd263498c28bd5a58696 /libc/sysdeps/linux/c6x/bits/elf-dsbt.h
parent8ae2b54ee70891ddb720bf00f8913c3716c1f67f (diff)
elf-{fdpic, dsbt}.h: avoid void pointer's subtraction
elf-fdpic.h or elf-dsbt.h is included by link.h. When C++ program includes <link.h>, we get following build failure. ../usr/include/bits/elf-fdpic.h: In function 'void* __reloc_pointer(void*, const elf32_fdpic_loadmap*)': ../usr/include/bits/elf-fdpic.h:95: error: invalid use of 'void' void pointer addition and subtraction is not allowed in C++ as it has undetermined size, however in C with language extension it is possible because sizeof void is treated as one byte. Instead of performing subtraction on void pointers, typecast it to char* first. This build failure is detected by Buildroot autobuilder. http://autobuild.buildroot.net/results/a10/a10ed48e6eb8411a3d8372f57c05fd11130da0e0/ Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
Diffstat (limited to 'libc/sysdeps/linux/c6x/bits/elf-dsbt.h')
-rw-r--r--libc/sysdeps/linux/c6x/bits/elf-dsbt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/c6x/bits/elf-dsbt.h b/libc/sysdeps/linux/c6x/bits/elf-dsbt.h
index a4e3e7db3..0e82ec790 100644
--- a/libc/sysdeps/linux/c6x/bits/elf-dsbt.h
+++ b/libc/sysdeps/linux/c6x/bits/elf-dsbt.h
@@ -94,7 +94,7 @@ __reloc_pointer (void *p,
for (c = 0; c < map->nsegs; c++)
{
- unsigned long offset = p - (void*)map->segs[c].p_vaddr;
+ unsigned long offset = (char*)p - (char*)map->segs[c].p_vaddr;
/* We only check for one-past-the-end for the second segment,
assumed to be the data segment, because other cases are
ambiguous in the absence of padding between segments, and