summary refs log tree commit diff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-07-22 18:02:42 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-12-28 08:40:38 -0300
commit8c0664e2b861fd3789602cc0b0b1922b0e20cb3a (patch)
tree8c6812231676fd89e69282941d0a59a2087a0ed1 /sysdeps/i386
parenteff687e8462b0eaf65992a6031b54a4b1cd16796 (diff)
downloadglibc-8c0664e2b861fd3789602cc0b0b1922b0e20cb3a.tar.gz
glibc-8c0664e2b861fd3789602cc0b0b1922b0e20cb3a.tar.xz
glibc-8c0664e2b861fd3789602cc0b0b1922b0e20cb3a.zip
elf: Add _dl_audit_pltexit
It consolidates the code required to call la_pltexit audit
callback.

Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/dl-fixup-attribute.h30
-rw-r--r--sysdeps/i386/dl-machine-rel.h2
-rw-r--r--sysdeps/i386/dl-machine.h23
-rw-r--r--sysdeps/i386/dl-trampoline.S2
4 files changed, 33 insertions, 24 deletions
diff --git a/sysdeps/i386/dl-fixup-attribute.h b/sysdeps/i386/dl-fixup-attribute.h
new file mode 100644
index 0000000000..c10e9936f4
--- /dev/null
+++ b/sysdeps/i386/dl-fixup-attribute.h
@@ -0,0 +1,30 @@
+/* ABI specifics for lazy resolution functions.  i386 version.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _DL_FIXUP_ATTRIBUTE_H
+#define _DL_FIXUP_ATTRIBUTE_H
+
+/* We cannot use this scheme for profiling because the _mcount call destroys
+   the passed register information.  */
+#ifndef PROF
+# define DL_ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused))
+#else
+# define DL_ARCH_FIXUP_ATTRIBUTE
+#endif
+
+#endif
diff --git a/sysdeps/i386/dl-machine-rel.h b/sysdeps/i386/dl-machine-rel.h
index 7ac46f78a6..bb3480d454 100644
--- a/sysdeps/i386/dl-machine-rel.h
+++ b/sysdeps/i386/dl-machine-rel.h
@@ -28,4 +28,6 @@
    Prelinked libraries may use Elf32_Rela though.  */
 #define ELF_MACHINE_PLT_REL 1
 
+#define PLTREL ElfW(Rel)
+
 #endif
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 169bed50ff..2f0dbc27a9 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -115,29 +115,6 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
   return lazy;
 }
 
-#ifdef IN_DL_RUNTIME
-
-# ifndef PROF
-/* We add a declaration of this function here so that in dl-runtime.c
-   the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
-   in registers.
-
-   We cannot use this scheme for profiling because the _mcount call
-   destroys the passed register information.  */
-#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused))
-
-extern ElfW(Addr) _dl_fixup (struct link_map *l,
-			     ElfW(Word) reloc_offset)
-     ARCH_FIXUP_ATTRIBUTE;
-extern ElfW(Addr) _dl_profile_fixup (struct link_map *l,
-				     ElfW(Word) reloc_offset,
-				     ElfW(Addr) retaddr, void *regs,
-				     long int *framesizep)
-     ARCH_FIXUP_ATTRIBUTE;
-# endif
-
-#endif
-
 /* Mask identifying addresses reserved for the user program,
    where the dynamic linker should not map anything.  */
 #define ELF_MACHINE_USER_ADDRESS_MASK	0xf0000000UL
diff --git a/sysdeps/i386/dl-trampoline.S b/sysdeps/i386/dl-trampoline.S
index 5669ab18f5..1e555de32e 100644
--- a/sysdeps/i386/dl-trampoline.S
+++ b/sysdeps/i386/dl-trampoline.S
@@ -252,7 +252,7 @@ _dl_runtime_profile:
 	movl (LRV_SIZE + 4 + LR_SIZE)(%esp), %eax
 	# PLT1
 	movl (LRV_SIZE + 4 + LR_SIZE + 4)(%esp), %edx
-	call _dl_call_pltexit
+	call _dl_audit_pltexit
 	movl LRV_EAX_OFFSET(%esp), %eax
 	movl LRV_EDX_OFFSET(%esp), %edx
 	fldt LRV_ST1_OFFSET(%esp)