aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/s390
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/s390
parent4a133885a7c8ae7ebe34e36fcdb353f8e94c810f (diff)
downloadglibc-55f41ef8de4a4d0c5762d78659e11202d3c765d4.zip
glibc-55f41ef8de4a4d0c5762d78659e11202d3c765d4.tar.gz
glibc-55f41ef8de4a4d0c5762d78659e11202d3c765d4.tar.bz2
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/s390')
-rw-r--r--sysdeps/s390/s390-32/dl-machine.h8
-rw-r--r--sysdeps/s390/s390-32/dl-trampoline.h2
-rw-r--r--sysdeps/s390/s390-64/dl-machine.h8
-rw-r--r--sysdeps/s390/s390-64/dl-trampoline.h2
4 files changed, 12 insertions, 8 deletions
diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h
index 100a3e0..b8bf279 100644
--- a/sysdeps/s390/s390-32/dl-machine.h
+++ b/sysdeps/s390/s390-32/dl-machine.h
@@ -124,16 +124,17 @@ 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
if (__glibc_unlikely (profile))
{
-#if defined HAVE_S390_VX_ASM_SUPPORT
+# if defined HAVE_S390_VX_ASM_SUPPORT
if (GLRO(dl_hwcap) & HWCAP_S390_VX)
got[2] = (Elf32_Addr) &_dl_runtime_profile_vx;
else
got[2] = (Elf32_Addr) &_dl_runtime_profile;
-#else
+# else
got[2] = (Elf32_Addr) &_dl_runtime_profile;
-#endif
+# endif
if (GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), l))
@@ -142,6 +143,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. */
diff --git a/sysdeps/s390/s390-32/dl-trampoline.h b/sysdeps/s390/s390-32/dl-trampoline.h
index 78fdca9..8093ab0 100644
--- a/sysdeps/s390/s390-32/dl-trampoline.h
+++ b/sysdeps/s390/s390-32/dl-trampoline.h
@@ -148,7 +148,7 @@ _dl_runtime_resolve:
#undef F0_OFF
#undef F2_OFF
-#ifndef PROF
+#if !defined PROF && defined SHARED
# define SIZEOF_STRUCT_LA_S390_32_REGS 168
# define REGS_OFF -264
# define R2_OFF -264
diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h
index 9fabb09..82259da 100644
--- a/sysdeps/s390/s390-64/dl-machine.h
+++ b/sysdeps/s390/s390-64/dl-machine.h
@@ -111,16 +111,17 @@ 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
if (__glibc_unlikely (profile))
{
-#if defined HAVE_S390_VX_ASM_SUPPORT
+# if defined HAVE_S390_VX_ASM_SUPPORT
if (GLRO(dl_hwcap) & HWCAP_S390_VX)
got[2] = (Elf64_Addr) &_dl_runtime_profile_vx;
else
got[2] = (Elf64_Addr) &_dl_runtime_profile;
-#else
+# else
got[2] = (Elf64_Addr) &_dl_runtime_profile;
-#endif
+# endif
if (GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), l))
@@ -129,6 +130,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. */
diff --git a/sysdeps/s390/s390-64/dl-trampoline.h b/sysdeps/s390/s390-64/dl-trampoline.h
index 3a7cfc5..6118811 100644
--- a/sysdeps/s390/s390-64/dl-trampoline.h
+++ b/sysdeps/s390/s390-64/dl-trampoline.h
@@ -150,7 +150,7 @@ _dl_runtime_resolve:
#undef F4_OFF
#undef F6_OFF
-#ifndef PROF
+#if !defined PROF && defined SHARED
# define SIZEOF_STRUCT_LA_S390_64_REGS 200
# define REGS_OFF -360
# define R2_OFF -360