00c0d4
commit 8c0664e2b861fd3789602cc0b0b1922b0e20cb3a
00c0d4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
00c0d4
Date:   Thu Jul 22 18:02:42 2021 -0300
00c0d4
00c0d4
    elf: Add _dl_audit_pltexit
00c0d4
    
00c0d4
    It consolidates the code required to call la_pltexit audit
00c0d4
    callback.
00c0d4
    
00c0d4
    Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu.
00c0d4
    
00c0d4
    Reviewed-by: Florian Weimer <fweimer@redhat.com>
00c0d4
00c0d4
Conflicts:
00c0d4
	nptl/tst-atfork4mod.c
00c0d4
	sysdeps/powerpc/fpu/s_fmaf.S
00c0d4
	sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c
00c0d4
	sysdeps/powerpc/powerpc64/power5+/fpu/s_floor.S
00c0d4
		Without d6d89608ac8cf2b37c75debad1fff653f6939f90 we
00c0d4
		don't have dl-machine-rel.h so git picks a match for
00c0d4
		all four files above, instead we modify dl-machine.h
00c0d4
		for the targets:
00c0d4
			sysdeps/i386/dl-machine.h
00c0d4
			sysdeps/arm/dl-machine.h
00c0d4
			sysdeps/mips/dl-machine.h
00c0d4
		The fourth is the generic file and without it we
00c0d4
		add the PLTREL macro to each target:
00c0d4
			sysdeps/aarch64/dl-machine.h
00c0d4
			sysdeps/powerpc/powerpc32/dl-machine.h
00c0d4
			sysdeps/powerpc/powerpc64/dl-machine.h
00c0d4
			sysdeps/s390/s390-32/dl-machine.h
00c0d4
			sysdeps/s390/s390-64/dl-machine.h
00c0d4
			sysdeps/x86_64/dl-machine.h
00c0d4
	sysdeps/s390/s390-32/dl-trampoline.h
00c0d4
	sysdeps/s390/s390-64/dl-trampoline.h
00c0d4
00c0d4
diff --git a/elf/dl-audit.c b/elf/dl-audit.c
00c0d4
index 15250c67e8ac1658..152712b12fed6de2 100644
00c0d4
--- a/elf/dl-audit.c
00c0d4
+++ b/elf/dl-audit.c
00c0d4
@@ -20,6 +20,8 @@
00c0d4
 #include <link.h>
00c0d4
 #include <ldsodefs.h>
00c0d4
 #include <dl-machine.h>
00c0d4
+#include <dl-runtime.h>
00c0d4
+#include <dl-fixup-attribute.h>
00c0d4
 
00c0d4
 void
00c0d4
 _dl_audit_activity_map (struct link_map *l, int action)
00c0d4
@@ -320,3 +322,48 @@ _dl_audit_pltenter (struct link_map *l, struct reloc_result *reloc_result,
00c0d4
 
00c0d4
   *value = DL_FIXUP_ADDR_VALUE (sym.st_value);
00c0d4
 }
00c0d4
+
00c0d4
+void
00c0d4
+DL_ARCH_FIXUP_ATTRIBUTE
00c0d4
+_dl_audit_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
00c0d4
+		   const void *inregs, void *outregs)
00c0d4
+{
00c0d4
+  const uintptr_t pltgot = (uintptr_t) D_PTR (l, l_info[DT_PLTGOT]);
00c0d4
+
00c0d4
+  /* This is the address in the array where we store the result of previous
00c0d4
+     relocations.  */
00c0d4
+  // XXX Maybe the bound information must be stored on the stack since
00c0d4
+  // XXX with bind_not a new value could have been stored in the meantime.
00c0d4
+  struct reloc_result *reloc_result =
00c0d4
+    &l->l_reloc_result[reloc_index (pltgot, reloc_arg, sizeof (PLTREL))];
00c0d4
+  ElfW(Sym) *defsym = ((ElfW(Sym) *) D_PTR (reloc_result->bound,
00c0d4
+					    l_info[DT_SYMTAB])
00c0d4
+		       + reloc_result->boundndx);
00c0d4
+
00c0d4
+  /* Set up the sym parameter.  */
00c0d4
+  ElfW(Sym) sym = *defsym;
00c0d4
+  sym.st_value = DL_FIXUP_VALUE_ADDR (reloc_result->addr);
00c0d4
+
00c0d4
+  /* Get the symbol name.  */
00c0d4
+  const char *strtab = (const void *) D_PTR (reloc_result->bound,
00c0d4
+					     l_info[DT_STRTAB]);
00c0d4
+  const char *symname = strtab + sym.st_name;
00c0d4
+
00c0d4
+  struct audit_ifaces *afct = GLRO(dl_audit);
00c0d4
+  for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
00c0d4
+    {
00c0d4
+      if (afct->ARCH_LA_PLTEXIT != NULL
00c0d4
+	  && (reloc_result->enterexit
00c0d4
+	      & (LA_SYMB_NOPLTEXIT >> (2 * cnt))) == 0)
00c0d4
+	{
00c0d4
+	  struct auditstate *l_state = link_map_audit_state (l, cnt);
00c0d4
+	  struct auditstate *bound_state
00c0d4
+	    = link_map_audit_state (reloc_result->bound, cnt);
00c0d4
+	  afct->ARCH_LA_PLTEXIT (&sym, reloc_result->boundndx,
00c0d4
+				 &l_state->cookie, &bound_state->cookie,
00c0d4
+				 inregs, outregs, symname);
00c0d4
+	}
00c0d4
+
00c0d4
+      afct = afct->next;
00c0d4
+    }
00c0d4
+}
00c0d4
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
00c0d4
index b46f7d7376e65361..ec0b2164825fa538 100644
00c0d4
--- a/elf/dl-runtime.c
00c0d4
+++ b/elf/dl-runtime.c
00c0d4
@@ -16,8 +16,6 @@
00c0d4
    License along with the GNU C Library; if not, see
00c0d4
    <http://www.gnu.org/licenses/>.  */
00c0d4
 
00c0d4
-#define IN_DL_RUNTIME 1		/* This can be tested in dl-machine.h.  */
00c0d4
-
00c0d4
 #include <alloca.h>
00c0d4
 #include <stdlib.h>
00c0d4
 #include <unistd.h>
00c0d4
@@ -30,19 +28,6 @@
00c0d4
 #include <dl-runtime.h>
00c0d4
 
00c0d4
 
00c0d4
-#if (!ELF_MACHINE_NO_RELA && !defined ELF_MACHINE_PLT_REL) \
00c0d4
-    || ELF_MACHINE_NO_REL
00c0d4
-# define PLTREL  ElfW(Rela)
00c0d4
-#else
00c0d4
-# define PLTREL  ElfW(Rel)
00c0d4
-#endif
00c0d4
-
00c0d4
-/* The fixup functions might have need special attributes.  If none
00c0d4
-   are provided define the macro as empty.  */
00c0d4
-#ifndef ARCH_FIXUP_ATTRIBUTE
00c0d4
-# define ARCH_FIXUP_ATTRIBUTE
00c0d4
-#endif
00c0d4
-
00c0d4
 /* This function is called through a special trampoline from the PLT the
00c0d4
    first time each PLT entry is called.  We must perform the relocation
00c0d4
    specified in the PLT of the given shared object, and return the resolved
00c0d4
@@ -51,7 +36,7 @@
00c0d4
    function.  */
00c0d4
 
00c0d4
 DL_FIXUP_VALUE_TYPE
00c0d4
-attribute_hidden __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
00c0d4
+attribute_hidden __attribute ((noinline)) DL_ARCH_FIXUP_ATTRIBUTE
00c0d4
 _dl_fixup (
00c0d4
 # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
00c0d4
 	   ELF_MACHINE_RUNTIME_FIXUP_ARGS,
00c0d4
@@ -147,7 +132,8 @@ _dl_fixup (
00c0d4
 
00c0d4
 #ifndef PROF
00c0d4
 DL_FIXUP_VALUE_TYPE
00c0d4
-__attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
00c0d4
+__attribute ((noinline))
00c0d4
+DL_ARCH_FIXUP_ATTRIBUTE
00c0d4
 _dl_profile_fixup (
00c0d4
 #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
00c0d4
 		   ELF_MACHINE_RUNTIME_FIXUP_ARGS,
00c0d4
@@ -331,52 +317,3 @@ _dl_profile_fixup (
00c0d4
 }
00c0d4
 
00c0d4
 #endif /* PROF */
00c0d4
-
00c0d4
-
00c0d4
-#include <stdio.h>
00c0d4
-void
00c0d4
-ARCH_FIXUP_ATTRIBUTE
00c0d4
-_dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
00c0d4
-		  const void *inregs, void *outregs)
00c0d4
-{
00c0d4
-#ifdef SHARED
00c0d4
-  const uintptr_t pltgot = (uintptr_t) D_PTR (l, l_info[DT_PLTGOT]);
00c0d4
-
00c0d4
-  /* This is the address in the array where we store the result of previous
00c0d4
-     relocations.  */
00c0d4
-  // XXX Maybe the bound information must be stored on the stack since
00c0d4
-  // XXX with bind_not a new value could have been stored in the meantime.
00c0d4
-  struct reloc_result *reloc_result =
00c0d4
-    &l->l_reloc_result[reloc_index (pltgot, reloc_arg, sizeof (PLTREL))];
00c0d4
-  ElfW(Sym) *defsym = ((ElfW(Sym) *) D_PTR (reloc_result->bound,
00c0d4
-					    l_info[DT_SYMTAB])
00c0d4
-		       + reloc_result->boundndx);
00c0d4
-
00c0d4
-  /* Set up the sym parameter.  */
00c0d4
-  ElfW(Sym) sym = *defsym;
00c0d4
-  sym.st_value = DL_FIXUP_VALUE_ADDR (reloc_result->addr);
00c0d4
-
00c0d4
-  /* Get the symbol name.  */
00c0d4
-  const char *strtab = (const void *) D_PTR (reloc_result->bound,
00c0d4
-					     l_info[DT_STRTAB]);
00c0d4
-  const char *symname = strtab + sym.st_name;
00c0d4
-
00c0d4
-  struct audit_ifaces *afct = GLRO(dl_audit);
00c0d4
-  for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
00c0d4
-    {
00c0d4
-      if (afct->ARCH_LA_PLTEXIT != NULL
00c0d4
-	  && (reloc_result->enterexit
00c0d4
-	      & (LA_SYMB_NOPLTEXIT >> (2 * cnt))) == 0)
00c0d4
-	{
00c0d4
-	  struct auditstate *l_state = link_map_audit_state (l, cnt);
00c0d4
-	  struct auditstate *bound_state
00c0d4
-	    = link_map_audit_state (reloc_result->bound, cnt);
00c0d4
-	  afct->ARCH_LA_PLTEXIT (&sym, reloc_result->boundndx,
00c0d4
-				 &l_state->cookie, &bound_state->cookie,
00c0d4
-				 inregs, outregs, symname);
00c0d4
-	}
00c0d4
-
00c0d4
-      afct = afct->next;
00c0d4
-    }
00c0d4
-#endif
00c0d4
-}
00c0d4
diff --git a/elf/dl-support.c b/elf/dl-support.c
00c0d4
index 3e5531138eaa18f8..e9943e889ef447ad 100644
00c0d4
--- a/elf/dl-support.c
00c0d4
+++ b/elf/dl-support.c
00c0d4
@@ -399,3 +399,11 @@ _dl_get_dl_main_map (void)
00c0d4
   return &_dl_main_map;
00c0d4
 }
00c0d4
 #endif
00c0d4
+
00c0d4
+/* This is used by _dl_runtime_profile, not used on static code.  */
00c0d4
+void
00c0d4
+DL_ARCH_FIXUP_ATTRIBUTE
00c0d4
+_dl_audit_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
00c0d4
+		   const void *inregs, void *outregs)
00c0d4
+{
00c0d4
+}
00c0d4
diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
00c0d4
index 5eab544afe2717f7..c13d896a57811c7d 100644
00c0d4
--- a/sysdeps/aarch64/dl-machine.h
00c0d4
+++ b/sysdeps/aarch64/dl-machine.h
00c0d4
@@ -196,6 +196,7 @@ _dl_start_user:								\n\
00c0d4
 /* AArch64 uses RELA not REL */
00c0d4
 #define ELF_MACHINE_NO_REL 1
00c0d4
 #define ELF_MACHINE_NO_RELA 0
00c0d4
+#define PLTREL ElfW(Rela)
00c0d4
 
00c0d4
 #define DL_PLATFORM_INIT dl_platform_init ()
00c0d4
 
00c0d4
diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S
00c0d4
index a86d0722d4a0415b..18740398e63fdf97 100644
00c0d4
--- a/sysdeps/aarch64/dl-trampoline.S
00c0d4
+++ b/sysdeps/aarch64/dl-trampoline.S
00c0d4
@@ -277,7 +277,7 @@ _dl_runtime_profile:
00c0d4
 	ldp	x0, x1, [x29, #OFFSET_SAVED_CALL_X0]
00c0d4
 	add	x2, x29, #OFFSET_RG
00c0d4
 	add	x3, x29, #OFFSET_RV
00c0d4
-	bl	_dl_call_pltexit
00c0d4
+	bl	_dl_audit_pltexit
00c0d4
 
00c0d4
 	ldp	x0, x1, [x29, #OFFSET_RV + DL_OFFSET_RV_X0]
00c0d4
 	ldp	d0, d1, [x29, #OFFSET_RV + DL_OFFSET_RV_D0 + 16*0]
00c0d4
diff --git a/sysdeps/alpha/dl-trampoline.S b/sysdeps/alpha/dl-trampoline.S
00c0d4
index b326b37acedb5eaa..3acf5dec8d9585da 100644
00c0d4
--- a/sysdeps/alpha/dl-trampoline.S
00c0d4
+++ b/sysdeps/alpha/dl-trampoline.S
00c0d4
@@ -187,7 +187,7 @@ _dl_runtime_profile_new:
00c0d4
 	jsr	$26, ($27), 0
00c0d4
 	ldgp	$29, 0($26)
00c0d4
 
00c0d4
-	/* Set up for call to _dl_call_pltexit.  */
00c0d4
+	/* Set up for call to _dl_audit_pltexit.  */
00c0d4
 	ldq	$16, 16*8($15)
00c0d4
 	ldq	$17, 17*8($15)
00c0d4
 	stq	$0, 16*8($15)
00c0d4
@@ -196,7 +196,7 @@ _dl_runtime_profile_new:
00c0d4
 	lda	$19, 16*8($15)
00c0d4
 	stt	$f0, 18*8($15)
00c0d4
 	stt	$f1, 19*8($15)
00c0d4
-	bsr	$26, _dl_call_pltexit	!samegp
00c0d4
+	bsr	$26, _dl_audit_pltexit	!samegp
00c0d4
 
00c0d4
 	mov	$15, $30
00c0d4
 	cfi_def_cfa_register (30)
00c0d4
@@ -518,7 +518,7 @@ _dl_runtime_profile_old:
00c0d4
 	jsr	$26, ($27), 0
00c0d4
 	ldgp	$29, 0($26)
00c0d4
 
00c0d4
-	/* Set up for call to _dl_call_pltexit.  */
00c0d4
+	/* Set up for call to _dl_audit_pltexit.  */
00c0d4
 	ldq	$16, 48*8($15)
00c0d4
 	ldq	$17, 49*8($15)
00c0d4
 	stq	$0, 46*8($15)
00c0d4
@@ -527,7 +527,7 @@ _dl_runtime_profile_old:
00c0d4
 	lda	$19, 46*8($15)
00c0d4
 	stt	$f0, 48*8($15)
00c0d4
 	stt	$f1, 49*8($15)
00c0d4
-	bsr	$26, _dl_call_pltexit	!samegp
00c0d4
+	bsr	$26, _dl_audit_pltexit	!samegp
00c0d4
 
00c0d4
 	mov	$15, $30
00c0d4
 	cfi_def_cfa_register (30)
00c0d4
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
00c0d4
index 1a4fd3f17b6df7da..9b5d0567df984c5d 100644
00c0d4
--- a/sysdeps/arm/dl-machine.h
00c0d4
+++ b/sysdeps/arm/dl-machine.h
00c0d4
@@ -260,6 +260,8 @@ _dl_start_user:\n\
00c0d4
    Prelinked libraries may use Elf32_Rela though.  */
00c0d4
 #define ELF_MACHINE_PLT_REL 1
00c0d4
 
00c0d4
+#define PLTREL ElfW(Rel)
00c0d4
+
00c0d4
 /* We define an initialization functions.  This is called very early in
00c0d4
    _dl_sysdep_start.  */
00c0d4
 #define DL_PLATFORM_INIT dl_platform_init ()
00c0d4
diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S
00c0d4
index c731b012869a9cbc..ced1b1cb1017d677 100644
00c0d4
--- a/sysdeps/arm/dl-trampoline.S
00c0d4
+++ b/sysdeps/arm/dl-trampoline.S
00c0d4
@@ -194,7 +194,7 @@ _dl_runtime_profile:
00c0d4
 	ldmia	ip, {r0,r1}
00c0d4
 	add	r2, r7, #72
00c0d4
 	add	r3, r7, #0
00c0d4
-	bl	_dl_call_pltexit
00c0d4
+	bl	_dl_audit_pltexit
00c0d4
 
00c0d4
 	@ Return to caller.
00c0d4
 	ldmia	r7, {r0-r3}
00c0d4
diff --git a/sysdeps/generic/dl-fixup-attribute.h b/sysdeps/generic/dl-fixup-attribute.h
00c0d4
new file mode 100644
00c0d4
index 0000000000000000..aa92169b709b3fea
00c0d4
--- /dev/null
00c0d4
+++ b/sysdeps/generic/dl-fixup-attribute.h
00c0d4
@@ -0,0 +1,24 @@
00c0d4
+/* ABI specifics for lazy resolution functions.
00c0d4
+   Copyright (C) 2021 Free Software Foundation, Inc.
00c0d4
+   This file is part of the GNU C Library.
00c0d4
+
00c0d4
+   The GNU C Library is free software; you can redistribute it and/or
00c0d4
+   modify it under the terms of the GNU Lesser General Public
00c0d4
+   License as published by the Free Software Foundation; either
00c0d4
+   version 2.1 of the License, or (at your option) any later version.
00c0d4
+
00c0d4
+   The GNU C Library is distributed in the hope that it will be useful,
00c0d4
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00c0d4
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00c0d4
+   Lesser General Public License for more details.
00c0d4
+
00c0d4
+   You should have received a copy of the GNU Lesser General Public
00c0d4
+   License along with the GNU C Library; if not, see
00c0d4
+   <https://www.gnu.org/licenses/>.  */
00c0d4
+
00c0d4
+#ifndef _DL_FIXUP_ATTRIBUTE_H
00c0d4
+#define _DL_FIXUP_ATTRIBUTE_H
00c0d4
+
00c0d4
+#define DL_ARCH_FIXUP_ATTRIBUTE
00c0d4
+
00c0d4
+#endif
00c0d4
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
00c0d4
index 47a9dee5b1c0ca63..29b77b35175c1116 100644
00c0d4
--- a/sysdeps/generic/ldsodefs.h
00c0d4
+++ b/sysdeps/generic/ldsodefs.h
00c0d4
@@ -35,6 +35,7 @@
00c0d4
 #include <link.h>
00c0d4
 #include <dl-lookupcfg.h>
00c0d4
 #include <dl-sysdep.h>
00c0d4
+#include <dl-fixup-attribute.h>
00c0d4
 #include <libc-lock.h>
00c0d4
 #include <hp-timing.h>
00c0d4
 #include <tls.h>
00c0d4
@@ -1311,6 +1312,11 @@ void _dl_audit_pltenter (struct link_map *l, struct reloc_result *reloc_result,
00c0d4
 			 DL_FIXUP_VALUE_TYPE *value, void *regs,
00c0d4
 			 long int *framesize)
00c0d4
   attribute_hidden;
00c0d4
+void DL_ARCH_FIXUP_ATTRIBUTE _dl_audit_pltexit (struct link_map *l,
00c0d4
+						ElfW(Word) reloc_arg,
00c0d4
+						const void *inregs,
00c0d4
+						void *outregs)
00c0d4
+  attribute_hidden;
00c0d4
 #endif /* SHARED */
00c0d4
 
00c0d4
 __END_DECLS
00c0d4
diff --git a/sysdeps/hppa/dl-runtime.c b/sysdeps/hppa/dl-runtime.c
00c0d4
index 2d061b150f0602c1..4c323131f937094b 100644
00c0d4
--- a/sysdeps/hppa/dl-runtime.c
00c0d4
+++ b/sysdeps/hppa/dl-runtime.c
00c0d4
@@ -26,7 +26,7 @@
00c0d4
    _dl_fixup with the relocation offset.  */
00c0d4
 
00c0d4
 ElfW(Word)
00c0d4
-attribute_hidden __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
00c0d4
+attribute_hidden __attribute ((noinline)) DL_ARCH_FIXUP_ATTRIBUTE
00c0d4
 _dl_fix_reloc_arg (struct fdesc *fptr, struct link_map *l)
00c0d4
 {
00c0d4
   Elf32_Addr l_addr, iplt, jmprel, end_jmprel, r_type;
00c0d4
diff --git a/sysdeps/hppa/dl-trampoline.S b/sysdeps/hppa/dl-trampoline.S
00c0d4
index 7ee4331cc2e7deff..3c83c8542f4fc63f 100644
00c0d4
--- a/sysdeps/hppa/dl-trampoline.S
00c0d4
+++ b/sysdeps/hppa/dl-trampoline.S
00c0d4
@@ -275,7 +275,7 @@ L(cont):
00c0d4
 	ldw	-4(%sp),%r1
00c0d4
 	copy	%r1, %sp
00c0d4
 
00c0d4
-	/* Arguments to _dl_call_pltexit */
00c0d4
+	/* Arguments to _dl_audit_pltexit */
00c0d4
 	ldw	-116(%sp), %r26		/* (1) got[1] == struct link_map */
00c0d4
 	ldw	-120(%sp), %r25		/* (2) reloc offsets */
00c0d4
 	ldo	-56(%sp), %r24		/* (3) *La_hppa_regs */
00c0d4
@@ -287,8 +287,8 @@ L(cont):
00c0d4
 	ldo	-128(%sp), %r1
00c0d4
 	fstd	%fr4,0(%r1)
00c0d4
 
00c0d4
-	/* Call _dl_call_pltexit */
00c0d4
-	bl	_dl_call_pltexit,%rp
00c0d4
+	/* Call _dl_audit_pltexit */
00c0d4
+	bl	_dl_audit_pltexit,%rp
00c0d4
 	nop
00c0d4
 
00c0d4
 	/* Restore *La_hppa_retval */
00c0d4
diff --git a/sysdeps/i386/dl-fixup-attribute.h b/sysdeps/i386/dl-fixup-attribute.h
00c0d4
new file mode 100644
00c0d4
index 0000000000000000..c10e9936f4db7254
00c0d4
--- /dev/null
00c0d4
+++ b/sysdeps/i386/dl-fixup-attribute.h
00c0d4
@@ -0,0 +1,30 @@
00c0d4
+/* ABI specifics for lazy resolution functions.  i386 version.
00c0d4
+   Copyright (C) 2021 Free Software Foundation, Inc.
00c0d4
+   This file is part of the GNU C Library.
00c0d4
+
00c0d4
+   The GNU C Library is free software; you can redistribute it and/or
00c0d4
+   modify it under the terms of the GNU Lesser General Public
00c0d4
+   License as published by the Free Software Foundation; either
00c0d4
+   version 2.1 of the License, or (at your option) any later version.
00c0d4
+
00c0d4
+   The GNU C Library is distributed in the hope that it will be useful,
00c0d4
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00c0d4
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00c0d4
+   Lesser General Public License for more details.
00c0d4
+
00c0d4
+   You should have received a copy of the GNU Lesser General Public
00c0d4
+   License along with the GNU C Library; if not, see
00c0d4
+   <https://www.gnu.org/licenses/>.  */
00c0d4
+
00c0d4
+#ifndef _DL_FIXUP_ATTRIBUTE_H
00c0d4
+#define _DL_FIXUP_ATTRIBUTE_H
00c0d4
+
00c0d4
+/* We cannot use this scheme for profiling because the _mcount call destroys
00c0d4
+   the passed register information.  */
00c0d4
+#ifndef PROF
00c0d4
+# define DL_ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused))
00c0d4
+#else
00c0d4
+# define DL_ARCH_FIXUP_ATTRIBUTE
00c0d4
+#endif
00c0d4
+
00c0d4
+#endif
00c0d4
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
00c0d4
index 5ba95b9e4af49942..30c3464fc4ac19d8 100644
00c0d4
--- a/sysdeps/i386/dl-machine.h
00c0d4
+++ b/sysdeps/i386/dl-machine.h
00c0d4
@@ -119,29 +119,6 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
00c0d4
   return lazy;
00c0d4
 }
00c0d4
 
00c0d4
-#ifdef IN_DL_RUNTIME
00c0d4
-
00c0d4
-# ifndef PROF
00c0d4
-/* We add a declaration of this function here so that in dl-runtime.c
00c0d4
-   the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
00c0d4
-   in registers.
00c0d4
-
00c0d4
-   We cannot use this scheme for profiling because the _mcount call
00c0d4
-   destroys the passed register information.  */
00c0d4
-#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused))
00c0d4
-
00c0d4
-extern ElfW(Addr) _dl_fixup (struct link_map *l,
00c0d4
-			     ElfW(Word) reloc_offset)
00c0d4
-     ARCH_FIXUP_ATTRIBUTE;
00c0d4
-extern ElfW(Addr) _dl_profile_fixup (struct link_map *l,
00c0d4
-				     ElfW(Word) reloc_offset,
00c0d4
-				     ElfW(Addr) retaddr, void *regs,
00c0d4
-				     long int *framesizep)
00c0d4
-     ARCH_FIXUP_ATTRIBUTE;
00c0d4
-# endif
00c0d4
-
00c0d4
-#endif
00c0d4
-
00c0d4
 /* Mask identifying addresses reserved for the user program,
00c0d4
    where the dynamic linker should not map anything.  */
00c0d4
 #define ELF_MACHINE_USER_ADDRESS_MASK	0xf8000000UL
00c0d4
@@ -240,6 +217,8 @@ _dl_start_user:\n\
00c0d4
    Prelinked libraries may use Elf32_Rela though.  */
00c0d4
 #define ELF_MACHINE_PLT_REL 1
00c0d4
 
00c0d4
+#define PLTREL ElfW(Rel)
00c0d4
+
00c0d4
 /* We define an initialization functions.  This is called very early in
00c0d4
    _dl_sysdep_start.  */
00c0d4
 #define DL_PLATFORM_INIT dl_platform_init ()
00c0d4
diff --git a/sysdeps/i386/dl-trampoline.S b/sysdeps/i386/dl-trampoline.S
00c0d4
index 6dc03192168ae2f3..a738b291a79bf8c2 100644
00c0d4
--- a/sysdeps/i386/dl-trampoline.S
00c0d4
+++ b/sysdeps/i386/dl-trampoline.S
00c0d4
@@ -265,7 +265,7 @@ _dl_runtime_profile:
00c0d4
 	movl (LRV_SIZE + 4 + LR_SIZE)(%esp), %eax
00c0d4
 	# PLT1
00c0d4
 	movl (LRV_SIZE + 4 + LR_SIZE + 4)(%esp), %edx
00c0d4
-	call _dl_call_pltexit
00c0d4
+	call _dl_audit_pltexit
00c0d4
 	movl LRV_EAX_OFFSET(%esp), %eax
00c0d4
 	movl LRV_EDX_OFFSET(%esp), %edx
00c0d4
 	fldt LRV_ST1_OFFSET(%esp)
00c0d4
diff --git a/sysdeps/ia64/dl-trampoline.S b/sysdeps/ia64/dl-trampoline.S
00c0d4
index fc24c425bfe6907b..caeca3afcd7db6b6 100644
00c0d4
--- a/sysdeps/ia64/dl-trampoline.S
00c0d4
+++ b/sysdeps/ia64/dl-trampoline.S
00c0d4
@@ -133,7 +133,7 @@ END(_dl_runtime_resolve)
00c0d4
 
00c0d4
 
00c0d4
 /* The fourth argument to _dl_profile_fixup and the third one to
00c0d4
-   _dl_call_pltexit are a pointer to La_ia64_regs:
00c0d4
+   _dl_audit_pltexit are a pointer to La_ia64_regs:
00c0d4
 
00c0d4
    8byte r8
00c0d4
    8byte r9
00c0d4
@@ -159,7 +159,7 @@ END(_dl_runtime_resolve)
00c0d4
    8byte sp
00c0d4
 
00c0d4
    The fifth argument to _dl_profile_fixup is a pointer to long int.
00c0d4
-   The fourth argument to _dl_call_pltexit is a pointer to
00c0d4
+   The fourth argument to _dl_audit_pltexit is a pointer to
00c0d4
    La_ia64_retval:
00c0d4
 
00c0d4
    8byte r8
00c0d4
@@ -261,7 +261,7 @@ ENTRY(_dl_runtime_profile)
00c0d4
 	}
00c0d4
 	{ .mii
00c0d4
 	  mov r18 = ar.unat	/* save it in La_ia64_regs */
00c0d4
-	  mov loc7 = out3	/* save it for _dl_call_pltexit */
00c0d4
+	  mov loc7 = out3	/* save it for _dl_audit_pltexit */
00c0d4
 	  mov loc5 = r11	/* preserve language specific register */
00c0d4
 	}
00c0d4
 	{ .mmi
00c0d4
@@ -272,7 +272,7 @@ ENTRY(_dl_runtime_profile)
00c0d4
 	}
00c0d4
 	{ .mii
00c0d4
 	  mov ar.unat = r17	/* restore it for function call */
00c0d4
-	  mov loc8 = r16	/* save it for _dl_call_pltexit */
00c0d4
+	  mov loc8 = r16	/* save it for _dl_audit_pltexit */
00c0d4
 	  nop.i 0x0
00c0d4
 	}
00c0d4
 	{ .mmi
00c0d4
@@ -291,7 +291,7 @@ ENTRY(_dl_runtime_profile)
00c0d4
 	{ .mmi
00c0d4
 	  stf.spill [r2] = f14, 32
00c0d4
 	  stf.spill [r3] = f15, 24
00c0d4
-	  mov loc9 = out1	/* save it for _dl_call_pltexit */
00c0d4
+	  mov loc9 = out1	/* save it for _dl_audit_pltexit */
00c0d4
 	  ;;
00c0d4
 	}
00c0d4
 	{ .mmb
00c0d4
@@ -426,7 +426,7 @@ ENTRY(_dl_runtime_profile)
00c0d4
 	  br.call.sptk.many b0 = b6
00c0d4
 	}
00c0d4
 	{ .mii
00c0d4
-	  /* Prepare stack for _dl_call_pltexit. Loc10 has the original
00c0d4
+	  /* Prepare stack for _dl_audit_pltexit. Loc10 has the original
00c0d4
 	     stack pointer.  */
00c0d4
 	  adds r12 = -PLTEXIT_FRAME_SIZE, loc10
00c0d4
 	  adds r2 = -(PLTEXIT_FRAME_SIZE - 16), loc10
00c0d4
@@ -461,14 +461,14 @@ ENTRY(_dl_runtime_profile)
00c0d4
 	{ .mmi
00c0d4
 	  stf.spill [r2] = f12, 32
00c0d4
 	  stf.spill [r3] = f13, 32
00c0d4
-	  /* We need to restore gp for _dl_call_pltexit. */
00c0d4
+	  /* We need to restore gp for _dl_audit_pltexit. */
00c0d4
 	  mov gp = loc11
00c0d4
 	  ;;
00c0d4
 	}
00c0d4
 	{ .mmb
00c0d4
 	  stf.spill [r2] = f14
00c0d4
 	  stf.spill [r3] = f15
00c0d4
-	  br.call.sptk.many b0 = _dl_call_pltexit
00c0d4
+	  br.call.sptk.many b0 = _dl_audit_pltexit
00c0d4
 	}
00c0d4
 	{ .mmi
00c0d4
 	  /* Load all the non-floating and floating return values. Skip
00c0d4
diff --git a/sysdeps/m68k/dl-trampoline.S b/sysdeps/m68k/dl-trampoline.S
00c0d4
index 7e1eace26b4a519d..27282ca8a6b1dada 100644
00c0d4
--- a/sysdeps/m68k/dl-trampoline.S
00c0d4
+++ b/sysdeps/m68k/dl-trampoline.S
00c0d4
@@ -202,7 +202,7 @@ _dl_runtime_profile:
00c0d4
 	cfi_adjust_cfa_offset (4)
00c0d4
 	move.l (32+FPSPACE)(%sp), -(%sp)
00c0d4
 	cfi_adjust_cfa_offset (4)
00c0d4
-	jbsr _dl_call_pltexit
00c0d4
+	jbsr _dl_audit_pltexit
00c0d4
 	lea 16(%sp), %sp
00c0d4
 	cfi_adjust_cfa_offset (-16)
00c0d4
 	move.l (%sp)+, %d0
00c0d4
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
00c0d4
index b41e10647d81843b..d4bd8b62f4b036a3 100644
00c0d4
--- a/sysdeps/mips/dl-machine.h
00c0d4
+++ b/sysdeps/mips/dl-machine.h
00c0d4
@@ -63,6 +63,7 @@
00c0d4
 #define ELF_MACHINE_PLT_REL 1
00c0d4
 #define ELF_MACHINE_NO_REL 0
00c0d4
 #define ELF_MACHINE_NO_RELA 0
00c0d4
+#define PLTREL ElfW(Rel)
00c0d4
 
00c0d4
 /* Translate a processor specific dynamic tag to the index
00c0d4
    in l_info array.  */
00c0d4
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h
00c0d4
index 31c7f3f95a2ce1b2..84322595793dc8bb 100644
00c0d4
--- a/sysdeps/powerpc/powerpc32/dl-machine.h
00c0d4
+++ b/sysdeps/powerpc/powerpc32/dl-machine.h
00c0d4
@@ -150,6 +150,7 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,
00c0d4
 /* The PowerPC never uses REL relocations.  */
00c0d4
 #define ELF_MACHINE_NO_REL 1
00c0d4
 #define ELF_MACHINE_NO_RELA 0
00c0d4
+#define PLTREL ElfW(Rela)
00c0d4
 
00c0d4
 /* We define an initialization function to initialize HWCAP/HWCAP2 and
00c0d4
    platform data so it can be copied into the TCB later.  This is called
00c0d4
diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h
00c0d4
index 35996bb9173da231..3af1f708378f9a3c 100644
00c0d4
--- a/sysdeps/powerpc/powerpc64/dl-machine.h
00c0d4
+++ b/sysdeps/powerpc/powerpc64/dl-machine.h
00c0d4
@@ -297,6 +297,7 @@ BODY_PREFIX "_dl_start_user:\n"						\
00c0d4
 /* The PowerPC never uses REL relocations.  */
00c0d4
 #define ELF_MACHINE_NO_REL 1
00c0d4
 #define ELF_MACHINE_NO_RELA 0
00c0d4
+#define PLTREL ElfW(Rela)
00c0d4
 
00c0d4
 /* We define an initialization function to initialize HWCAP/HWCAP2 and
00c0d4
    platform data so it can be copied into the TCB later.  This is called
00c0d4
diff --git a/sysdeps/powerpc/powerpc64/dl-trampoline.S b/sysdeps/powerpc/powerpc64/dl-trampoline.S
00c0d4
index aa141dc44b980d9b..23290d32360507fd 100644
00c0d4
--- a/sysdeps/powerpc/powerpc64/dl-trampoline.S
00c0d4
+++ b/sysdeps/powerpc/powerpc64/dl-trampoline.S
00c0d4
@@ -197,7 +197,7 @@ END(_dl_runtime_resolve)
00c0d4
 #ifndef PROF
00c0d4
 ENTRY (_dl_profile_resolve, 4)
00c0d4
 /* Spill r30, r31 to preserve the link_map* and reloc_addr, in case we
00c0d4
-   need to call _dl_call_pltexit.  */
00c0d4
+   need to call _dl_audit_pltexit.  */
00c0d4
 	std	r31,-8(r1)
00c0d4
 	std	r30,-16(r1)
00c0d4
 /* We need to save the registers used to pass parameters, ie. r3 thru
00c0d4
@@ -452,7 +452,7 @@ L(restoreFXR2):
00c0d4
 L(callpltexit):
00c0d4
 	addi	r5,r1,INT_PARMS
00c0d4
 	addi	r6,r1,INT_RTN
00c0d4
-	bl	JUMPTARGET(_dl_call_pltexit)
00c0d4
+	bl	JUMPTARGET(_dl_audit_pltexit)
00c0d4
 #ifndef SHARED
00c0d4
 	nop
00c0d4
 #endif
00c0d4
diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h
00c0d4
index ded41adff80346b6..2f3bb085ae2b6794 100644
00c0d4
--- a/sysdeps/s390/s390-32/dl-machine.h
00c0d4
+++ b/sysdeps/s390/s390-32/dl-machine.h
00c0d4
@@ -279,6 +279,7 @@ _dl_start_user:\n\
00c0d4
 /* The S390 never uses Elf32_Rel relocations.  */
00c0d4
 #define ELF_MACHINE_NO_REL 1
00c0d4
 #define ELF_MACHINE_NO_RELA 0
00c0d4
+#define PLTREL ElfW(Rela)
00c0d4
 
00c0d4
 /* We define an initialization functions.  This is called very early in
00c0d4
    _dl_sysdep_start.  */
00c0d4
diff --git a/sysdeps/s390/s390-32/dl-trampoline.h b/sysdeps/s390/s390-32/dl-trampoline.h
00c0d4
index d36c002743bf2f0c..c447a41f067c462b 100644
00c0d4
--- a/sysdeps/s390/s390-32/dl-trampoline.h
00c0d4
+++ b/sysdeps/s390/s390-32/dl-trampoline.h
00c0d4
@@ -207,7 +207,7 @@ _dl_runtime_profile:
00c0d4
 	basr   %r1,0
00c0d4
 5:	l      %r14,7f-5b(%r1)
00c0d4
 	la     %r5,40(%r12)		# pointer to struct La_s390_32_retval
00c0d4
-	bas    %r14,0(%r14,%r1)		# call _dl_call_pltexit
00c0d4
+	bas    %r14,0(%r14,%r1)		# call _dl_audit_pltexit
00c0d4
 
00c0d4
 	lr     %r15,%r12		# remove stack frame
00c0d4
 	cfi_def_cfa_register (15)
00c0d4
@@ -224,7 +224,7 @@ _dl_runtime_profile:
00c0d4
 	br     %r14
00c0d4
 
00c0d4
 6:	.long  _dl_profile_fixup - 0b
00c0d4
-7:	.long  _dl_call_pltexit - 5b
00c0d4
+7:	.long  _dl_audit_pltexit - 5b
00c0d4
 	cfi_endproc
00c0d4
 	.size _dl_runtime_profile, .-_dl_runtime_profile
00c0d4
 #endif
00c0d4
diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h
00c0d4
index 36327c40a1972dd7..033e7c9916e751f4 100644
00c0d4
--- a/sysdeps/s390/s390-64/dl-machine.h
00c0d4
+++ b/sysdeps/s390/s390-64/dl-machine.h
00c0d4
@@ -228,6 +228,7 @@ _dl_start_user:\n\
00c0d4
 /* The 64 bit S/390 never uses Elf64_Rel relocations.  */
00c0d4
 #define ELF_MACHINE_NO_REL 1
00c0d4
 #define ELF_MACHINE_NO_RELA 0
00c0d4
+#define PLTREL ElfW(Rela)
00c0d4
 
00c0d4
 /* We define an initialization functions.  This is called very early in
00c0d4
    _dl_sysdep_start.  */
00c0d4
diff --git a/sysdeps/s390/s390-64/dl-trampoline.h b/sysdeps/s390/s390-64/dl-trampoline.h
00c0d4
index d313fd521db0b859..18534d629ebc00e2 100644
00c0d4
--- a/sysdeps/s390/s390-64/dl-trampoline.h
00c0d4
+++ b/sysdeps/s390/s390-64/dl-trampoline.h
00c0d4
@@ -203,7 +203,7 @@ _dl_runtime_profile:
00c0d4
 	lmg    %r2,%r4,48(%r12)		# r2, r3: load arguments saved by PLT
00c0d4
 					# r4: pointer to struct La_s390_64_regs
00c0d4
 	la     %r5,72(%r12)		# pointer to struct La_s390_64_retval
00c0d4
-	brasl  %r14,_dl_call_pltexit
00c0d4
+	brasl  %r14,_dl_audit_pltexit
00c0d4
 
00c0d4
 	lgr    %r15,%r12		# remove stack frame
00c0d4
 	cfi_def_cfa_register (15)
00c0d4
diff --git a/sysdeps/sh/dl-trampoline.S b/sysdeps/sh/dl-trampoline.S
00c0d4
index 0c8f84d26d3015ca..73f865f2af4e2d48 100644
00c0d4
--- a/sysdeps/sh/dl-trampoline.S
00c0d4
+++ b/sysdeps/sh/dl-trampoline.S
00c0d4
@@ -423,8 +423,8 @@ _dl_runtime_profile:
00c0d4
 	.align 2
00c0d4
 #ifdef SHARED
00c0d4
 7:	.long _GLOBAL_OFFSET_TABLE_
00c0d4
-8:	.long _dl_call_pltexit@GOTOFF
00c0d4
+8:	.long _dl_audit_pltexit@GOTOFF
00c0d4
 #else
00c0d4
-8:	.long _dl_call_pltexit
00c0d4
+8:	.long _dl_audit_pltexit
00c0d4
 #endif
00c0d4
 	.size _dl_runtime_profile, .-_dl_runtime_profile
00c0d4
diff --git a/sysdeps/sparc/sparc32/dl-trampoline.S b/sysdeps/sparc/sparc32/dl-trampoline.S
00c0d4
index 098ffcfacc55d0b6..18ef2f0d3655b3de 100644
00c0d4
--- a/sysdeps/sparc/sparc32/dl-trampoline.S
00c0d4
+++ b/sysdeps/sparc/sparc32/dl-trampoline.S
00c0d4
@@ -127,7 +127,7 @@ _dl_profile_invoke:
00c0d4
 	mov	%l5, %o0
00c0d4
 	mov	%l6, %o1
00c0d4
 	add	%sp, (11 * 8), %o2
00c0d4
-	call	_dl_call_pltexit
00c0d4
+	call	_dl_audit_pltexit
00c0d4
 	 add	%sp, ( 9 * 8), %o3
00c0d4
 
00c0d4
 	ldd	[%sp + ( 9 * 8)], %i0
00c0d4
diff --git a/sysdeps/sparc/sparc64/dl-trampoline.S b/sysdeps/sparc/sparc64/dl-trampoline.S
00c0d4
index 4948b88b9640691d..9c18ceb131c9a25b 100644
00c0d4
--- a/sysdeps/sparc/sparc64/dl-trampoline.S
00c0d4
+++ b/sysdeps/sparc/sparc64/dl-trampoline.S
00c0d4
@@ -196,7 +196,7 @@ _dl_profile_invoke:
00c0d4
 	mov	%l5, %o0
00c0d4
 	mov	%l6, %o1
00c0d4
 	add	%sp, STACK_BIAS + (24 * 8), %o2
00c0d4
-	call	_dl_call_pltexit
00c0d4
+	call	_dl_audit_pltexit
00c0d4
 	 add	%sp, STACK_BIAS + (16 * 8), %o3
00c0d4
 
00c0d4
 	ldx	[%sp + STACK_BIAS + (16 * 8)], %i0
00c0d4
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
00c0d4
index 5262aa69c06aa8db..d30317980882ac51 100644
00c0d4
--- a/sysdeps/x86_64/dl-machine.h
00c0d4
+++ b/sysdeps/x86_64/dl-machine.h
00c0d4
@@ -210,6 +210,7 @@ _dl_start_user:\n\
00c0d4
 /* The x86-64 never uses Elf64_Rel/Elf32_Rel relocations.  */
00c0d4
 #define ELF_MACHINE_NO_REL 1
00c0d4
 #define ELF_MACHINE_NO_RELA 0
00c0d4
+#define PLTREL ElfW(Rela)
00c0d4
 
00c0d4
 /* We define an initialization function.  This is called very early in
00c0d4
    _dl_sysdep_start.  */
00c0d4
diff --git a/sysdeps/x86_64/dl-runtime.h b/sysdeps/x86_64/dl-runtime.h
00c0d4
index 3fa61d7a4697cf3f..379f8bd4dea8ef97 100644
00c0d4
--- a/sysdeps/x86_64/dl-runtime.h
00c0d4
+++ b/sysdeps/x86_64/dl-runtime.h
00c0d4
@@ -18,7 +18,7 @@
00c0d4
    02111-1307 USA.  */
00c0d4
 
00c0d4
 /* The ABI calls for the PLT stubs to pass the index of the relocation
00c0d4
-   and not its offset.  In _dl_profile_fixup and _dl_call_pltexit we
00c0d4
+   and not its offset.  In _dl_profile_fixup and _dl_audit_pltexit we
00c0d4
    also use the index.  Therefore it is wasteful to compute the offset
00c0d4
    in the trampoline just to reverse the operation immediately
00c0d4
    afterwards.  */
00c0d4
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
00c0d4
index a28b1e73a4b187ba..256dfbb64df9f03d 100644
00c0d4
--- a/sysdeps/x86_64/dl-trampoline.h
00c0d4
+++ b/sysdeps/x86_64/dl-trampoline.h
00c0d4
@@ -388,7 +388,7 @@ _dl_runtime_profile:
00c0d4
 	jns 3f
00c0d4
 
00c0d4
 	/* There's nothing in the frame size, so there
00c0d4
-	   will be no call to the _dl_call_pltexit. */
00c0d4
+	   will be no call to the _dl_audit_pltexit. */
00c0d4
 
00c0d4
 	/* Get back registers content.  */
00c0d4
 	movq LR_RCX_OFFSET(%rsp), %rcx
00c0d4
@@ -436,7 +436,7 @@ _dl_runtime_profile:
00c0d4
 	mov 24(%rbx), %RSP_LP	# Drop the copied stack content
00c0d4
 
00c0d4
 	/* Now we have to prepare the La_x86_64_retval structure for the
00c0d4
-	   _dl_call_pltexit.  The La_x86_64_regs is being pointed by rsp now,
00c0d4
+	   _dl_audit_pltexit.  The La_x86_64_regs is being pointed by rsp now,
00c0d4
 	   so we just need to allocate the sizeof(La_x86_64_retval) space on
00c0d4
 	   the stack, since the alignment has already been taken care of. */
00c0d4
 # ifdef RESTORE_AVX
00c0d4
@@ -491,7 +491,7 @@ _dl_runtime_profile:
00c0d4
 	movq 24(%rbx), %rdx	# La_x86_64_regs argument to %rdx.
00c0d4
 	movq 40(%rbx), %rsi	# Copy args pushed by PLT in register.
00c0d4
 	movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_index
00c0d4
-	call _dl_call_pltexit
00c0d4
+	call _dl_audit_pltexit
00c0d4
 
00c0d4
 	/* Restore return registers.  */
00c0d4
 	movq LRV_RAX_OFFSET(%rsp), %rax