Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/ld.elf_so Introduce a cast to fix the build for Elf3...
details: https://anonhg.NetBSD.org/src/rev/1cbf670c25ce
branches: trunk
changeset: 331827:1cbf670c25ce
user: christos <christos%NetBSD.org@localhost>
date: Tue Aug 26 07:54:27 2014 +0000
description:
Introduce a cast to fix the build for Elf32 on _LP64.
diffstat:
libexec/ld.elf_so/headers.c | 8 ++++----
libexec/ld.elf_so/rtld.h | 15 ++++++++++++---
2 files changed, 16 insertions(+), 7 deletions(-)
diffs (70 lines):
diff -r e84380283959 -r 1cbf670c25ce libexec/ld.elf_so/headers.c
--- a/libexec/ld.elf_so/headers.c Tue Aug 26 00:48:29 2014 +0000
+++ b/libexec/ld.elf_so/headers.c Tue Aug 26 07:54:27 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: headers.c,v 1.55 2014/08/25 20:40:52 joerg Exp $ */
+/* $NetBSD: headers.c,v 1.56 2014/08/26 07:54:27 christos Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: headers.c,v 1.55 2014/08/25 20:40:52 joerg Exp $");
+__RCSID("$NetBSD: headers.c,v 1.56 2014/08/26 07:54:27 christos Exp $");
#endif /* not lint */
#include <err.h>
@@ -345,9 +345,9 @@
}
if (init != 0)
- obj->init = (Elf_Addr)obj->relocbase + init;
+ obj->init = (Elf_Addr) RTLD_ELF32_CAST obj->relocbase + init;
if (fini != 0)
- obj->fini = (Elf_Addr)obj->relocbase + fini;
+ obj->fini = (Elf_Addr) RTLD_ELF32_CAST obj->relocbase + fini;
if (dyn_rpath != NULL) {
_rtld_add_paths(execname, &obj->rpaths, obj->strtab +
diff -r e84380283959 -r 1cbf670c25ce libexec/ld.elf_so/rtld.h
--- a/libexec/ld.elf_so/rtld.h Tue Aug 26 00:48:29 2014 +0000
+++ b/libexec/ld.elf_so/rtld.h Tue Aug 26 07:54:27 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtld.h,v 1.120 2014/08/25 20:40:52 joerg Exp $ */
+/* $NetBSD: rtld.h,v 1.121 2014/08/26 07:54:27 christos Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -475,6 +475,15 @@
void _rtld_obj_free(Obj_Entry *);
Obj_Entry *_rtld_obj_new(void);
+/*
+ * The following uintptr_t cast is for Elf32 emulation on _LP64 systems
+ */
+#if defined(_LP64) && ELFSIZE == 32
+#define RTLD_ELF32_CAST (uintptr_t)
+#else
+#define RTLD_ELF32_CAST
+#endif
+
/* function descriptors */
#ifdef __HAVE_FUNCTION_DESCRIPTORS
Elf_Addr _rtld_function_descriptor_alloc(const Obj_Entry *,
@@ -487,12 +496,12 @@
static inline void
_rtld_call_function_void(const Obj_Entry *obj, Elf_Addr addr)
{
- ((void (*)(void))addr)();
+ ((void (*)(void)) RTLD_ELF32_CAST addr)();
}
static inline Elf_Addr
_rtld_call_function_addr(const Obj_Entry *obj, Elf_Addr addr)
{
- return ((Elf_Addr(*)(void))addr)();
+ return ((Elf_Addr(*)(void)) RTLD_ELF32_CAST addr)();
}
#endif /* __HAVE_FUNCTION_DESCRIPTORS */
Home |
Main Index |
Thread Index |
Old Index