summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/patchelf.cc (renamed from src/patchelf.c)8
3 files changed, 7 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 71f2489..1ad50cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,5 +16,7 @@ if test "$STABLE" != "1"; then
fi
AC_PROG_CC
+AC_PROG_CXX
+
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index d61eee2..0bf1f83 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,3 @@
bin_PROGRAMS = patchelf
-patchelf_SOURCES = patchelf.c
+patchelf_SOURCES = patchelf.cc
diff --git a/src/patchelf.c b/src/patchelf.cc
index a957aa1..d0a5a2c 100644
--- a/src/patchelf.c
+++ b/src/patchelf.cc
@@ -65,7 +65,7 @@ static void readFile(char * fileName, mode_t * fileMode)
*fileMode = st.st_mode;
maxSize = fileSize + 128 * 1024;
- contents = malloc(fileSize + maxSize);
+ contents = (unsigned char *) malloc(fileSize + maxSize);
if (!contents) abort();
int fd = open(fileName, O_RDONLY);
@@ -169,7 +169,7 @@ static void setInterpreter(void)
growFile(phdr->p_offset + interpSize);
phdr->p_vaddr = phdr->p_paddr = firstPage + interpOffset % 4096;
phdr->p_filesz = phdr->p_memsz = interpSize;
- strncpy(contents + interpOffset,
+ strncpy((char *) contents + interpOffset,
newInterpreter, interpSize);
changed = 1;
break;
@@ -219,7 +219,7 @@ static void shrinkRPath(void)
if (phdrs[i].p_vaddr <= strTabAddr &&
strTabAddr < phdrs[i].p_vaddr + phdrs[i].p_filesz)
{
- strTab = contents +
+ strTab = (char *) contents +
strTabAddr - phdrs[i].p_vaddr + phdrs[i].p_offset;
}
@@ -257,7 +257,7 @@ static void shrinkRPath(void)
for (i = 0; i < nrNeededLibs; ++i)
neededLibFound[i] = 0;
- char * newRPath = malloc(strlen(rpath) + 1);
+ char * newRPath = (char *) malloc(strlen(rpath) + 1);
*newRPath = 0;
char * pos = rpath;