summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-08-14 01:54:13 +0000
committerUlrich Drepper <drepper@redhat.com>1997-08-14 01:54:13 +0000
commitca34d7a7c77fa8dc823fd05439870e5a96610c5a (patch)
tree4b4057b8b919007f42caa4e1558bb9c5487976ae /elf
parent0413b54c02d31cae62e8d13b3ee7ac109ceeff0e (diff)
downloadglibc-ca34d7a7c77fa8dc823fd05439870e5a96610c5a.tar.gz
glibc-ca34d7a7c77fa8dc823fd05439870e5a96610c5a.tar.xz
glibc-ca34d7a7c77fa8dc823fd05439870e5a96610c5a.zip
1997-08-14 03:14  Ulrich Drepper  <drepper@cygnus.com>

	* elf/dl-minimal.c: Don't use relative #include paths.
	(malloc): Don't try to initialize _dl_pagesize, it already is.
	(__sigjmp_save, longjmp): Reformat.

	* sysdeps/generic/dl-sysdep.c: Implement _dl_show_auxv function to
	show content of auxiliary array.
	(_dl_sysdep_start): Remember start of auxiliary vector.
	* sysdeps/mach/hurd/dl-sysdep.c: (_dl_show_auxv): New dummy function.
	* elf/link.h: Add prototype for _dl_show_auxv.
	* elf/rtld.c (dl_main): Call _dl_show_auxv if LD_SHOW_AUXV envvar
	is present.

	* libio/iofdopen.c: Better prepare for use in libstdc++.
	* libio/iofflush.c: Likewise.
	* libio/iofgetpos.c: Likewise.
	* libio/iofgets.c: Likewise.
	* libio/iofopen.c: Likewise.
	* libio/iofputs.c: Likewise.
	* libio/iofread.c: Likewise.
	* libio/iofsetpos.c: Likewise.
	* libio/ioftell.c: Likewise.
	* libio/iofwrite.c: Likewise.
	* libio/iogetdelim.c: Likewise.
	* libio/iogets.c: Likewise.
	* libio/iopopen.c: Likewise.
	* libio/ioputs.c: Likewise.
	* libio/iosetbuffer.c: Likewise.
	* libio/iosetvbuf.c: Likewise.
	* libio/ioungetc.c: Likewise.
	* libio/iovsprintf.c: Likewise.
	* libio/iovsscanf.c: Likewise.

	* manual/creature.texi: Mention _XOPEN_SOURCE_EXTENDED in correct
	place.

	* manual/math.texi: Add comment to sincos decsription to say it's a
	GNU extension.
	Fix description of random function.

	* posix/fnmatch.h: Recognize Windog by _WINDOWS32 not WIN32.
	* posix/glob.c: Likewise.  Handle stupid system headers on SunOS.
	Add casts for all __alloca calls.
	* posix/glob.h: Recognize Windog by _WINDOWS32 not WIN32.
	Declare additional GLOB_* constants also if _GNU_SOURCE is defined.
	Patches by Paul D. Smith <psmith@BayNetworks.COM>.

	* stdio-common/_itoa.c: Don't use relateive #include paths.

	* sysdeps/i386/fpu/bits/mathinline.h: Enable optimizations even for
	gcc 2.7.
	(atan): Loading 1.0 from memory does not pay off.
	(asinh): Fix typo.

1997-08-13 09:44  Philip Blundell  <Philip.Blundell@pobox.com>

	* sysdeps/stub/accept.c: Use socklen_t where necessary.
	* sysdeps/stub/bind.c: Likewise.
	* sysdeps/stub/connect.c: Likewise.
	* sysdeps/stub/getsockname.c: Likewise.
	* sysdeps/stub/getsockopt.c: Likewise.
	* sysdeps/stub/recvfrom.c: Likewise.
	* sysdeps/stub/sendto.c: Likewise.
	* sysdeps/stub/setsockopt.c: Likewise.

1997-08-11  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* io/ftw.c (object_compare): Avoid memcmp when comparing scalar
	types.

1997-08-12  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* math/libm-test.c (cbrt_test): Add epsilon for long double to
	`cbrt (-0.001)'.

1997-08-11  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/stub/bits/string.h: Fix comment.

1997-08-01  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* elf/Makefile (routines): Remove dl-version.
	(dl-routines): Add it here instead.  This removes dead code from
	libc.so.

1997-08-12 17:17  Wolfram Gloger  <wmglo@dent.med.uni-muenchen.de>

	* malloc/thread-m.h (thread_atfork, thread_atfork_static): New
	macros to encapsulate pthread_atfork's functionality.
	* malloc/malloc.c (ptmalloc_lock_all, ptmalloc_unlock_all): New
	functions, registered via thread_atfork in the initialization
	routine or via thread_atfork_static in global scope.  This
	ensures a consistent state of all locks across fork().

1997-08-11 23:00:32 1997  Mark Kettenis  <kettenis@phys.uva.nl>

	* login/programs/xtmp.c (compare_entry):
	Partially undo patch made by Klaus Espenlaub.  There
	was no xtmp/utmp typo.  Added comment to cclarify this.
	* login/programs/xtmp.h: Likewise.

	* posix/getopt.c: Recognize Windog by _WINDOWS32 not WIN32.
	Patch by Paul D. Smith <psmith@BayNetworks.COM>.

1997-08-12 13:51  Ulrich Drepper  <drepper@cygnus.com>

	* login/getutid.c: Rename to __getutid and make getutid and getutxid
	weak aliases.
	Patch by ir. Mark M._Kettenis <kettenis@phys.uva.nl>.

1997-08-11 23:55  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/Makefile [subdir=misc] (sysdep_headers):
	Add bits/mman.h.

1997-08-11 08:51:21 1997  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* stdlib/fmtmsg.c (fmtmsg): Add static to
	__libc_once_define macro.

	* libc.map (__progname_full, __progname): Added.

1997-08-04 08:31  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Return 0
	if SIOGIFINDEX is not defined.
	(if_indextoname): Initialize "result" to NULL.
	(if_nametoindex, if_nameindex): Fix ENOSYS setting.

1997-08-11 11:58  Richard Henderson  <rth@cygnus.com>

	Sparc ISO C 9x exception handling:
	* sysdeps/sparc/fpu/bits/mathdef.h: New file.
	* sysdeps/sparc/fpu/fclrexcpt.c: New file.
	* sysdeps/sparc/fpu/fegetenv.c: New file.
	* sysdeps/sparc/fpu/fegetround.c: New file.
	* sysdeps/sparc/fpu/feholdexcpt.c: New file.
	* sysdeps/sparc/fpu/fesetenv.c: New file.
	* sysdeps/sparc/fpu/fesetround.c: New file.
	* sysdeps/sparc/fpu/feupdateenv.c: New file.
	* sysdeps/sparc/fpu/fgetexcptflg.c: New file.
	* sysdeps/sparc/fpu/fraiseexcpt.c: New file.
	* sysdeps/sparc/fpu/fsetexcptflg.c: New file.
	* sysdeps/sparc/fpu/ftestexcept.c: New file.
	* sysdeps/sparc/sparc32/fpu/bits/fenv.h: New file.
	* sysdeps/sparc/sparc64/fpu/bits/fenv.h: New file.

1997-08-11 11:58  Richard Henderson  <rth@cygnus.com>

	Sparc64 merge:
	* configure.in: Change up subdirectories, rename sparc8->sparcv8.

	* csu/Makefile: Nuke need-nopic-initfini bits.  The problem was
	that sparc64 ld did not recognize pic relocs at all.

	* elf/dl-deps.c: Include <string.h>.
	* elf/do-rel.h (elf_dynamic_do_rel): Take reloc address and size
	directly instead of the DT names to get them from.
	* elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): New macro distilled
	from ELF_DYNAMIC_DO_REL{,A}.  Define a second version that accounts
	for the possibility that DT_RELA and DT_JMPPLT overlap, as such is
	the case on the Sparc.

	* elf/elf.h: Stub out Elf64_Ver*, and make them the same as the
	Elf32_Ver* bits.  The linker does not even know to differentiate
	between the word sizes.  Someone should examine this and figure
	out what the proper sizes of things should be for 64-bit hosts
	before the sparc64 libraries are distributed.

	* shlib-versions: Rename sparc64 ld.so to not conflict with sparc32
	on the same machine.

	Move old sysdeps/sparc contents to sysdeps/sparc/sparc32,
	rename sparc8 subdir to sparcv8, move sysdeps/sparc64 content to
	sysdeps/sparc/sparc64.  Same for sysdeps/unix/sysv/linux/sparc.

	* sysdeps/sparc/Implies: Do ieee754 here.
	* sysdeps/sparc/configure.in: Move from sparc32/.
	* sysdeps/sparc/sparc32/Implies: Do wordsize here.
	* sysdeps/sparc/sparc64/Implies: Likewise.

	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_load_address):
	Use uninitialized .got to find load address instead of AT_BASE, as
	the later does not exist when running ld.so directly.

	* sysdeps/sparc/sparc32/fpu/fpu_control.h: Move from ../.
	* sysdeps/sparc/sparc64/fpu/fpu_control.h: Likewise.

	* sysdeps/sparc/sparc32/udiv_qrnnd.S: Clean up PIC support.

	* sysdeps/sparc/sparc64/Makefile (sysdep_routines): Add s_finitel
	and s_signbitl for stdio.
	* sysdeps/sparc/sparc64/configure.in: Remove, we no longer need
	nopic_initfini.

	* sysdeps/sparc/sparc64/bsd-_setjmp.S: Remove.
	* sysdeps/sparc/sparc64/bsd-setjmp.S: Remove.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bsd-_setjmp.S: New empty file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bsd-setjmp.S: New empty file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Add __longjmp alias.
	* sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S: Add weak _setjmp
	and setjmp entry points.

	* sysdeps/sparc/sparc64/dl-machine.h: Finish real implementation.

	* sysdeps/sparc/sparc64/elf/crtbegin.S: Add copyright, fix PIC.
	* sysdeps/sparc/sparc64/elf/crtend.S: Likewise.

	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h (struct sigaction):
	Fix sa_flags size for sparc64; add sa_restorer for kernel.

	* sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Fix PIC.
	* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/init-first.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.

	* sysdeps/unix/sysv/linux/sparc/sparc64/syscall.S: New file.

1997-08-10 18:29:08 1997  Mark Kettenis  <kettenis@phys.uva.nl>

	* login/login.c (login): Check for correct return value of
	utmpname.

1997-08-11 16:49  Ulrich Drepper  <drepper@cygnus.com>

	* time/tzset.c (__tzset_internal): Correctly handle TZ strings
	following incorrect old POSIX specs.
	Patch by Paul Eggert <eggert@twinsun.com>.

	* sysdeps/generic/bits/sigaction.h: Correct comment for SA_RESTART.
	* sysdeps/unix/bsd/osf/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/minix/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/sysv4/bits/sigaction.h: Likewise.
	Reported by NIIBE Yutaka <gniibe@mri.co.jp>.

1997-08-09  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* manual/math.texi: Define the macros @mul and @infinity and use
	them to format the multiplication and infinity signs.
	(FP Comparison Functions): Use @code, not @math, for C code
	examples.

	* elf/dl-profile.c: Add descriptions and implement reading of
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile4
-rw-r--r--elf/dl-deps.c2
-rw-r--r--elf/dl-minimal.c15
-rw-r--r--elf/do-rel.h7
-rw-r--r--elf/dynamic-link.h81
-rw-r--r--elf/elf.h51
-rw-r--r--elf/link.h4
-rw-r--r--elf/rtld.c5
8 files changed, 144 insertions, 25 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 904099cbeb..f8dc9d0ef2 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -22,13 +22,13 @@ subdir		:= elf
 
 headers		= elf.h bits/elfclass.h bits/dlfcn.h link.h dlfcn.h
 routines	= $(dl-routines) dl-open dl-close dl-symbol dl-support \
-		  dl-version enbl-secure
+		  enbl-secure
 
 # The core dynamic linking functions are in libc for the static and
 # profiled libraries.
 dl-routines	= $(addprefix dl-,load cache lookup object reloc deps \
 			          runtime error init fini debug misc \
-				  profile)
+				  version profile)
 # But they are absent from the shared libc, because that code is in ld.so.
 elide-routines.so = $(dl-routines) dl-support enbl-secure
 
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index e990d6965b..3fbb3dbf92 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -21,7 +21,7 @@
 #include <errno.h>
 #include <dlfcn.h>
 #include <stdlib.h>
-
+#include <string.h>
 #include <assert.h>
 
 /* Whether an shared object references one or more auxiliary objects
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 486e5bc608..a76e01dcb8 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -23,7 +23,7 @@
 #include <assert.h>
 #include <string.h>
 #include <link.h>
-#include "../stdio-common/_itoa.h"
+#include <stdio-common/_itoa.h>
 
 /* Minimal `malloc' allocator for use while loading shared libraries.
    Only small blocks are allocated, and none are ever freed.  */
@@ -43,9 +43,6 @@ malloc (size_t n)
 #define MAP_ANON 0
 #endif
 
-  if (_dl_pagesize == 0)
-    _dl_pagesize = __getpagesize ();
-
   if (alloc_end == 0)
     {
       /* Consume any unused space in the last page of our data segment.  */
@@ -115,10 +112,16 @@ realloc (void *ptr, size_t n)
 
 int weak_function
 __sigjmp_save (sigjmp_buf env, int savemask)
-{ env[0].__mask_was_saved = savemask; return 0; }
+{
+  env[0].__mask_was_saved = savemask;
+  return 0;
+}
 
 void weak_function
-longjmp (jmp_buf env, int val) { __longjmp (env[0].__jmpbuf, val); }
+longjmp (jmp_buf env, int val)
+{
+  __longjmp (env[0].__jmpbuf, val);
+}
 
 /* Define our own stub for the localization function used by strerror.
    English-only in the dynamic linker keeps it smaller.  */
diff --git a/elf/do-rel.h b/elf/do-rel.h
index 7f4b1259a2..2e0f26bd05 100644
--- a/elf/do-rel.h
+++ b/elf/do-rel.h
@@ -37,12 +37,11 @@
 
 static inline void
 elf_dynamic_do_rel (struct link_map *map,
-		    int reltag, int sztag,
+		    ElfW(Addr) reladdr, ElfW(Addr) relsize,
 		    int lazy)
 {
-  const ElfW(Rel) *r
-    = (const ElfW(Rel) *) (map->l_addr + map->l_info[reltag]->d_un.d_ptr);
-  const ElfW(Rel) *end = &r[map->l_info[sztag]->d_un.d_val / sizeof *r];
+  const ElfW(Rel) *r = (const ElfW(Rel) *)(map->l_addr + reladdr);
+  const ElfW(Rel) *end = (const ElfW(Rel) *)(map->l_addr + reladdr + relsize);
 
   if (lazy)
     /* Doing lazy PLT relocations; they need very little info.  */
diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index 4a946f8ad8..64b5f78bc7 100644
--- a/elf/dynamic-link.h
+++ b/elf/dynamic-link.h
@@ -75,14 +75,75 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn,
    duplicating their code.  It cannot be done in a more general function
    because we must be able to completely inline.  */
 
+/* On some machines, notably Sparc, DT_REL* includes DT_JMPREL in its
+   range.  Note that according to the ELF spec, this is completely legal!
+   But conditionally define things so that on machines we know this will
+   not happen we do something more optimal.  */
+
+#ifdef ELF_MACHINE_PLTREL_OVERLAP
+#define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, lazy) \
+  do {									      \
+    ElfW(Addr) r_addr, r_size, p_addr, p_size;				      \
+    if ((map)->l_info[DT_##RELOC])					      \
+      {									      \
+        r_addr = (map)->l_info[DT_##RELOC]->d_un.d_ptr;			      \
+        r_size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val;		      \
+        if ((map)->l_info[DT_PLTREL] &&					      \
+            (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)		      \
+	  {								      \
+	    p_addr = (map)->l_info[DT_JMPREL]->d_un.d_ptr;		      \
+	    p_size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val;		      \
+	    if (r_addr <= p_addr && r_addr+r_size > p_addr)		      \
+	      {								      \
+		ElfW(Addr) r2_addr, r2_size;				      \
+		r2_addr = p_addr+p_size;				      \
+		if (r2_addr < r_addr+r_size)				      \
+		  {							      \
+		    r2_size = r_addr+r_size - r2_addr;			      \
+		    elf_dynamic_do_##reloc ((map), r2_addr, r2_size, 0);      \
+		  }							      \
+		r_size = p_addr - r_addr;				      \
+	      }								      \
+	  }								      \
+									      \
+	elf_dynamic_do_##reloc ((map), r_addr, r_size, 0);		      \
+	if (p_addr)							      \
+	  elf_dynamic_do_##reloc ((map), p_addr, p_size, (lazy));	      \
+      }									      \
+    else if ((map)->l_info[DT_PLTREL] &&				      \
+	     (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)	      \
+      {									      \
+	p_addr = (map)->l_info[DT_JMPREL]->d_un.d_ptr;			      \
+	p_size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val;		      \
+									      \
+	elf_dynamic_do_##reloc ((map), p_addr, p_size, (lazy));		      \
+      }									      \
+  } while (0)
+#else
+#define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, lazy) \
+  do {									      \
+    if ((map)->l_info[DT_##RELOC])					      \
+      {									      \
+	ElfW(Addr) r_addr, r_size;					      \
+        r_addr = (map)->l_info[DT_##RELOC]->d_un.d_ptr;			      \
+        r_size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val;		      \
+	elf_dynamic_do_##reloc ((map), r_addr, r_size, 0);		      \
+      }									      \
+    if ((map)->l_info[DT_PLTREL] &&					      \
+	(map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)		      \
+      {									      \
+	ElfW(Addr) p_addr, p_size;					      \
+	p_addr = (map)->l_info[DT_JMPREL]->d_un.d_ptr;			      \
+	p_size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val;		      \
+	elf_dynamic_do_##reloc ((map), p_addr, p_size, (lazy));		      \
+      }									      \
+  } while (0)
+#endif
+
 #if ! ELF_MACHINE_NO_REL
 #include "do-rel.h"
-#define ELF_DYNAMIC_DO_REL(map, lazy)					      \
-  if ((map)->l_info[DT_REL])						      \
-    elf_dynamic_do_rel ((map), DT_REL, DT_RELSZ, 0);			      \
-  if ((map)->l_info[DT_PLTREL] &&					      \
-      (map)->l_info[DT_PLTREL]->d_un.d_val == DT_REL)			      \
-    elf_dynamic_do_rel ((map), DT_JMPREL, DT_PLTRELSZ, (lazy));
+#define ELF_DYNAMIC_DO_REL(map, lazy) \
+  _ELF_DYNAMIC_DO_RELOC (REL, rel, map, lazy)
 #else
 #define ELF_DYNAMIC_DO_REL(map, lazy) /* Nothing to do.  */
 #endif
@@ -90,12 +151,8 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn,
 #if ! ELF_MACHINE_NO_RELA
 #define DO_RELA
 #include "do-rel.h"
-#define ELF_DYNAMIC_DO_RELA(map, lazy)					      \
-  if ((map)->l_info[DT_RELA])						      \
-    elf_dynamic_do_rela ((map), DT_RELA, DT_RELASZ, 0);			      \
-  if ((map)->l_info[DT_PLTREL] &&					      \
-      (map)->l_info[DT_PLTREL]->d_un.d_val == DT_RELA)			      \
-    elf_dynamic_do_rela ((map), DT_JMPREL, DT_PLTRELSZ, (lazy));
+#define ELF_DYNAMIC_DO_RELA(map, lazy) \
+  _ELF_DYNAMIC_DO_RELOC (RELA, rela, map, lazy)
 #else
 #define ELF_DYNAMIC_DO_RELA(map, lazy) /* Nothing to do.  */
 #endif
diff --git a/elf/elf.h b/elf/elf.h
index 02d092ffac..e78bcb5102 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -505,6 +505,7 @@ typedef struct
 					   entry */
 } Elf32_Verdef;
 
+#if 0
 /* XXX We have no information what types should be used for 64 bit
    architectures.  What is following is only an intelligent guess.  */
 typedef struct
@@ -518,6 +519,11 @@ typedef struct
   Elf64_Word	vd_next;		/* Offset in bytes to next verdef
 					   entry */
 } Elf64_Verdef;
+#else
+/* The linker doesn't even parameterize the version info swapping
+   routines.  I wonder if it should or is this good enough.  */
+typedef Elf32_Verdef Elf64_Verdef;
+#endif
 
 /* Legal values for vd_version (version revision).  */
 #define VER_DEF_NONE	0		/* No version */
@@ -537,6 +543,7 @@ typedef struct
 					   entry */
 } Elf32_Verdaux;
 
+#if 0
 /* XXX We have no information what types should be used for 64 bit
    architectures.  What is following is only an intelligent guess.  */
 typedef struct
@@ -545,6 +552,10 @@ typedef struct
   Elf64_Word	vda_next;		/* Offset in bytes to next verdaux
 					   entry */
 } Elf64_Verdaux;
+#else
+/* The linker doesn't even parameterize this -- should it?  */
+typedef Elf32_Verdaux Elf64_Verdaux;
+#endif
 
 /* Version dependency section.  */
 
@@ -559,6 +570,7 @@ typedef struct
 					   entry */
 } Elf32_Verneed;
 
+#if 0
 /* XXX We have no information what types should be used for 64 bit
    architectures.  What is following is only an intelligent guess.  */
 typedef struct
@@ -571,6 +583,10 @@ typedef struct
   Elf64_Word	vn_next;		/* Offset in bytes to next verneed
 					   entry */
 } Elf64_Verneed;
+#else
+/* The linker doesn't even parameterize this -- should it?  */
+typedef Elf32_Verneed Elf64_Verneed;
+#endif
 
 /* Legal values for vn_version (version revision).  */
 #define VER_NEED_NONE	 0		/* No version */
@@ -589,6 +605,7 @@ typedef struct
 					   entry */
 } Elf32_Vernaux;
 
+#if 0
 /* XXX We have no information what types should be used for 64 bit
    architectures.  What is following is only an intelligent guess.  */
 typedef struct
@@ -600,6 +617,10 @@ typedef struct
   Elf64_Word	vna_next;		/* Offset in bytes to next vernaux
 					   entry */
 } Elf64_Vernaux;
+#else
+/* The linker doesn't even parameterize these -- should it?  */
+typedef Elf32_Vernaux Elf64_Vernaux;
+#endif
 
 /* Legal values for vna_flags.  */
 #define VER_FLG_WEAK	0x2		/* Weak verison identifier */
@@ -732,6 +753,36 @@ typedef struct
 #define R_SPARC_RELATIVE 22		/* Adjust by program base */
 #define R_SPARC_UA32	23		/* Direct 32 bit unaligned */
 
+/* Additional Sparc64 relocs.  */
+
+#define R_SPARC_PLT32	24		/* Direct 32 bit ref to PLT entry */
+#define R_SPARC_HIPLT22	25		/* High 22 bit PLT entry */
+#define R_SPARC_LOPLT10	26		/* Truncated 10 bit PLT entry */
+#define R_SPARC_PCPLT32	27		/* PC rel 32 bit ref to PLT entry */
+#define R_SPARC_PCPLT22	28		/* PC rel high 22 bit PLT entry */
+#define R_SPARC_PCPLT10	29		/* PC rel trunc 10 bit PLT entry */
+#define R_SPARC_10	30		/* Direct 10 bit */
+#define R_SPARC_11	31		/* Direct 11 bit */
+#define R_SPARC_64	32		/* Direct 64 bit */
+#define R_SPARC_OLO10	33		/* ?? */
+#define R_SPARC_HH22	34		/* Top 22 bits of direct 64 bit */
+#define R_SPARC_HM10	35		/* High middle 10 bits of ... */
+#define R_SPARC_LM22	36		/* Low middle 22 bits of ... */
+#define R_SPARC_PC_HH22	37		/* Top 22 bits of pc rel 64 bit */
+#define R_SPARC_PC_HM10	38		/* High middle 10 bit of ... */
+#define R_SPARC_PC_LM22	39		/* Low miggle 22 bits of ... */
+#define R_SPARC_WDISP16	40		/* PC relative 16 bit shifted */
+#define R_SPARC_WDISP19	41		/* PC relative 19 bit shifted */
+#define R_SPARC_GLOB_JMP 42		/* ?? */
+#define R_SPARC_7	43		/* Direct 7 bit */
+#define R_SPARC_5	44		/* Direct 5 bit */
+#define R_SPARC_6	45		/* Direct 6 bit */
+
+/* For Sparc64, legal values for d_tag of Elf64_Dyn.  */
+
+#define DT_SPARC_PLTFMT	0x70000001	/* .plt format version/type */
+#define DT_SPARC_NUM	2
+
 /* MIPS R3000 specific definitions.  */
 
 /* Legal values for e_flags field of Elf32_Ehdr.  */
diff --git a/elf/link.h b/elf/link.h
index 38a7c88d9a..a90854a2ea 100644
--- a/elf/link.h
+++ b/elf/link.h
@@ -444,6 +444,10 @@ extern void _dl_start_profile (struct link_map *map, const char *output_dir);
 /* The actual functions used to keep book on the calls.  */
 extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
 
+
+/* Show the member of the auxiliry aray passed up from the kernel.  */
+extern void _dl_show_auxv (void);
+
 __END_DECLS
 
 #endif /* link.h */
diff --git a/elf/rtld.c b/elf/rtld.c
index 726463c882..c3d81e198f 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -261,6 +261,11 @@ dl_main (const ElfW(Phdr) *phdr,
   char *file;
   int has_interp = 0;
 
+  /* Test whether we want to see the content of the auxiliary array passed
+     up from the kernel.  */
+  if (getenv ("LD_SHOW_AUXV") != NULL)
+    _dl_show_auxv ();
+
   mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
   _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;