aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/arm
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-11-06 17:25:46 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-11-21 16:15:42 -0300
commit55f41ef8de4a4d0c5762d78659e11202d3c765d4 (patch)
tree205676e94304e4a3a43e3a4eee4e027986593f09 /sysdeps/arm
parent4a133885a7c8ae7ebe34e36fcdb353f8e94c810f (diff)
downloadglibc-55f41ef8de4a4d0c5762d78659e11202d3c765d4.tar
glibc-55f41ef8de4a4d0c5762d78659e11202d3c765d4.tar.gz
glibc-55f41ef8de4a4d0c5762d78659e11202d3c765d4.tar.bz2
glibc-55f41ef8de4a4d0c5762d78659e11202d3c765d4.zip
elf: Remove LD_PROFILE for static binaries
The _dl_non_dynamic_init does not parse LD_PROFILE, which does not enable profile for dlopen objects. Since dlopen is deprecated for static objects, it is better to remove the support. It also allows to trim down libc.a of profile support. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'sysdeps/arm')
-rw-r--r--sysdeps/arm/dl-machine.h4
-rw-r--r--sysdeps/arm/dl-trampoline.S2
2 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
index d720c02c96..a68679e653 100644
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -65,7 +65,6 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
{
Elf32_Addr *got;
extern void _dl_runtime_resolve (Elf32_Word);
- extern void _dl_runtime_profile (Elf32_Word);
if (l->l_info[DT_JMPREL] && lazy)
{
@@ -88,6 +87,8 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
to intercept the calls to collect information. In this case we
don't store the address in the GOT so that all future calls also
end in this function. */
+#ifdef SHARED
+ extern void _dl_runtime_profile (Elf32_Word);
if (profile)
{
got[2] = (Elf32_Addr) &_dl_runtime_profile;
@@ -99,6 +100,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
GL(dl_profile_map) = l;
}
else
+#endif
/* This function will get called to fix up the GOT entry indicated by
the offset on the stack, and then jump to the resolved address. */
got[2] = (Elf32_Addr) &_dl_runtime_resolve;
diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S
index 23c2476917..2df5b7ee36 100644
--- a/sysdeps/arm/dl-trampoline.S
+++ b/sysdeps/arm/dl-trampoline.S
@@ -70,7 +70,7 @@ _dl_runtime_resolve:
cfi_endproc
.size _dl_runtime_resolve, .-_dl_runtime_resolve
-#ifndef PROF
+#if !defined PROF && defined SHARED
.globl _dl_runtime_profile
.type _dl_runtime_profile, #function
CFI_SECTIONS