NetBSD re-synchronization of the source tree

This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
This commit is contained in:
2015-10-15 17:01:16 +02:00
parent 8933525b85
commit 0a6a1f1d05
32425 changed files with 2998623 additions and 1342348 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: headers.c,v 1.52 2013/08/03 13:17:05 skrll Exp $ */
/* $NetBSD: headers.c,v 1.59 2014/08/26 21:20:05 joerg Exp $ */
/*
* Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: headers.c,v 1.52 2013/08/03 13:17:05 skrll Exp $");
__RCSID("$NetBSD: headers.c,v 1.59 2014/08/26 21:20:05 joerg Exp $");
#endif /* not lint */
#include <err.h>
@@ -74,7 +74,9 @@ _rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
bool use_pltrela = false;
Elf_Addr relsz = 0, relasz = 0;
Elf_Addr pltrel = 0, pltrelsz = 0;
#ifdef RTLD_LOADER
Elf_Addr init = 0, fini = 0;
#endif
dbg(("headers: digesting PT_DYNAMIC at %p", obj->dynamic));
for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; ++dynp) {
@@ -227,13 +229,15 @@ _rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
break;
case DT_INIT:
#ifdef RTLD_LOADER
init = dynp->d_un.d_ptr;
#endif
break;
#ifdef HAVE_INITFINI_ARRAY
case DT_INIT_ARRAY:
obj->init_array =
(fptr_t *)(obj->relocbase + dynp->d_un.d_ptr);
(Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr);
dbg(("headers: DT_INIT_ARRAY at %p",
obj->init_array));
break;
@@ -246,13 +250,15 @@ _rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
#endif
case DT_FINI:
#ifdef RTLD_LOADER
fini = dynp->d_un.d_ptr;
#endif
break;
#ifdef HAVE_INITFINI_ARRAY
case DT_FINI_ARRAY:
obj->fini_array =
(fptr_t *)(obj->relocbase + dynp->d_un.d_ptr);
(Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr);
dbg(("headers: DT_FINI_ARRAY at %p",
obj->fini_array));
break;
@@ -298,9 +304,15 @@ _rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
break;
#endif
#ifdef __powerpc__
#ifdef _LP64
case DT_PPC64_GLINK:
obj->glink = (Elf_Addr)(uintptr_t)obj->relocbase + dynp->d_un.d_ptr;
break;
#else
case DT_PPC_GOT:
obj->gotptr = (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr);
break;
#endif
#endif
case DT_FLAGS_1:
obj->z_now =
@@ -339,20 +351,11 @@ _rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
obj->relalim = obj->pltrela;
}
#if defined(RTLD_LOADER) && defined(__HAVE_FUNCTION_DESCRIPTORS)
#ifdef RTLD_LOADER
if (init != 0)
obj->init = (void (*)(void))
_rtld_function_descriptor_alloc(obj, NULL, init);
obj->init = (Elf_Addr) obj->relocbase + init;
if (fini != 0)
obj->fini = (void (*)(void))
_rtld_function_descriptor_alloc(obj, NULL, fini);
#else
if (init != 0)
obj->init = (void (*)(void))
(obj->relocbase + init);
if (fini != 0)
obj->fini = (void (*)(void))
(obj->relocbase + fini);
obj->fini = (Elf_Addr) obj->relocbase + fini;
#endif
if (dyn_rpath != NULL) {