From 8c0664e2b861fd3789602cc0b0b1922b0e20cb3a Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 22 Jul 2021 18:02:42 -0300 Subject: 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 --- sysdeps/x86_64/dl-runtime.h | 2 +- sysdeps/x86_64/dl-trampoline.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sysdeps/x86_64') diff --git a/sysdeps/x86_64/dl-runtime.h b/sysdeps/x86_64/dl-runtime.h index 9c8d397..19ba33e 100644 --- a/sysdeps/x86_64/dl-runtime.h +++ b/sysdeps/x86_64/dl-runtime.h @@ -18,7 +18,7 @@ 02111-1307 USA. */ /* The ABI calls for the PLT stubs to pass the index of the relocation - and not its offset. In _dl_profile_fixup and _dl_call_pltexit we + and not its offset. In _dl_profile_fixup and _dl_audit_pltexit we also use the index. Therefore it is wasteful to compute the offset in the trampoline just to reverse the operation immediately afterwards. */ diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h index dfbfefb..812f67f 100644 --- a/sysdeps/x86_64/dl-trampoline.h +++ b/sysdeps/x86_64/dl-trampoline.h @@ -357,7 +357,7 @@ _dl_runtime_profile: jns 3f /* There's nothing in the frame size, so there - will be no call to the _dl_call_pltexit. */ + will be no call to the _dl_audit_pltexit. */ /* Get back registers content. */ movq LR_RCX_OFFSET(%rsp), %rcx @@ -403,7 +403,7 @@ _dl_runtime_profile: mov 24(%rbx), %RSP_LP # Drop the copied stack content /* Now we have to prepare the La_x86_64_retval structure for the - _dl_call_pltexit. The La_x86_64_regs is being pointed by rsp now, + _dl_audit_pltexit. The La_x86_64_regs is being pointed by rsp now, so we just need to allocate the sizeof(La_x86_64_retval) space on the stack, since the alignment has already been taken care of. */ # ifdef RESTORE_AVX @@ -448,7 +448,7 @@ _dl_runtime_profile: movq 24(%rbx), %rdx # La_x86_64_regs argument to %rdx. movq 40(%rbx), %rsi # Copy args pushed by PLT in register. movq 32(%rbx), %rdi # %rdi: link_map, %rsi: reloc_index - call _dl_call_pltexit + call _dl_audit_pltexit /* Restore return registers. */ movq LRV_RAX_OFFSET(%rsp), %rax -- cgit v1.1