glibc/glibc-upstream-2.39-217.patch
Arjun Shankar 53f4d259fa Sync with upstream branch release/2.39/master (RHEL-109536)
Upstream commit: fffc2df8a3e2c8cda2991063d23086360268b777

- i386: Provide GLIBC_ABI_GNU_TLS symbol version [BZ #33221]
- i386: Update ___tls_get_addr to preserve vector registers
- Extend struct r_debug to support multiple namespaces (RHEL-101985)
- Fix a potential crash in the dynamic loader when processing specific
  symbol versions (RHEL-109683)
- Signal la_objopen for ld.so with dlmopen (RHEL-109693)
- Switch to main malloc after final ld.so self-relocation (RHEL-109703)
- Prevent ld.so from asserting and crashing during audited library loads
  (RHEL-109702)
- x86-64: Provide GLIBC_ABI_DT_X86_64_PLT symbol version (RHEL-109621)
- x86-64, i386: Provide GLIBC_ABI_GNU2_TLS symbol version (RHEL-109625)
- Ensure fallback initialization of ctype TLS data pointers to fix segfaults in
  programs using dlmopen or auditors (RHEL-72018)
- Handle load segment gaps in _dl_find_object (RHEL-104854)
- AArch64: Improve codegen in SVE log1p
- AArch64: Optimize inverse trig functions
- AArch64: Avoid memset ifunc in cpu-features.c [BZ #33112]

Resolves: RHEL-109536

Resolves: RHEL-72018
Resolves: RHEL-101985
Resolves: RHEL-104854
Resolves: RHEL-109621
Resolves: RHEL-109625
Resolves: RHEL-109683
Resolves: RHEL-109693
Resolves: RHEL-109702
Resolves: RHEL-109703
2025-08-21 10:25:39 +02:00

94 lines
2.8 KiB
Diff

commit 9833fcf7ce7a7ac7ec5b7694fd4c2bc705282842
Author: Florian Weimer <fweimer@redhat.com>
Date: Sat Feb 1 12:37:58 2025 +0100
elf: Do not add a copy of _dl_find_object to libc.so
This reduces code size and dependencies on ld.so internals from
libc.so.
Fixes commit f4c142bb9fe6b02c0af8cfca8a920091e2dba44b
("arm: Use _dl_find_object on __gnu_Unwind_Find_exidx (BZ 31405)").
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 96429bcc91a14f71b177ddc5e716de3069060f2c)
diff --git a/elf/Makefile b/elf/Makefile
index f5646c434f19a667..92da608da1ebc175 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -34,7 +34,6 @@ routines = \
dl-addr \
dl-addr-obj \
dl-early_allocate \
- dl-find_object \
dl-iteratephdr \
dl-libc \
dl-origin \
@@ -61,6 +60,7 @@ dl-routines = \
dl-deps \
dl-exception \
dl-execstack \
+ dl-find_object \
dl-fini \
dl-init \
dl-load \
diff --git a/elf/dl-find_object.c b/elf/dl-find_object.c
index 449302eda35ce96f..940fa5c2236af666 100644
--- a/elf/dl-find_object.c
+++ b/elf/dl-find_object.c
@@ -356,7 +356,7 @@ _dlfo_lookup (uintptr_t pc, struct dl_find_object_internal *first1, size_t size)
}
int
-__dl_find_object (void *pc1, struct dl_find_object *result)
+_dl_find_object (void *pc1, struct dl_find_object *result)
{
uintptr_t pc = (uintptr_t) pc1;
@@ -463,8 +463,7 @@ __dl_find_object (void *pc1, struct dl_find_object *result)
return -1;
} /* Transaction retry loop. */
}
-hidden_def (__dl_find_object)
-weak_alias (__dl_find_object, _dl_find_object)
+rtld_hidden_def (_dl_find_object)
/* _dlfo_process_initial is called twice. First to compute the array
sizes from the initial loaded mappings. Second to fill in the
diff --git a/include/dlfcn.h b/include/dlfcn.h
index f49ee1b0c9958d38..a44420fa37439a85 100644
--- a/include/dlfcn.h
+++ b/include/dlfcn.h
@@ -4,8 +4,7 @@
#include <link.h> /* For ElfW. */
#include <stdbool.h>
-extern __typeof (_dl_find_object) __dl_find_object;
-hidden_proto (__dl_find_object)
+rtld_hidden_proto (_dl_find_object)
/* Internally used flag. */
#define __RTLD_DLOPEN 0x80000000
diff --git a/sysdeps/arm/find_exidx.c b/sysdeps/arm/find_exidx.c
index a924d59b9f75d7b2..4257c268381df540 100644
--- a/sysdeps/arm/find_exidx.c
+++ b/sysdeps/arm/find_exidx.c
@@ -15,6 +15,7 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
+#include <ldsodefs.h>
#include <link.h>
/* Find the exception index table containing PC. */
@@ -23,7 +24,7 @@ _Unwind_Ptr
__gnu_Unwind_Find_exidx (_Unwind_Ptr pc, int * pcount)
{
struct dl_find_object data;
- if (__dl_find_object ((void *) pc, &data) < 0)
+ if (GLRO(dl_find_object) ((void *) pc, &data) < 0)
return 0;
*pcount = data.dlfo_eh_count;
return (_Unwind_Ptr) data.dlfo_eh_frame;