glibc/glibc-RHEL-48820-2.patch
Frédéric Bérat 7a4b319108 Switch to main malloc after final ld.so self-relocation
- Backport: elf: rtld_multiple_ref is always true
- Backport: elf: Do not define consider_profiling, consider_symbind as
  macros
- Backport: elf: Introduce _dl_relocate_object_no_relro
- Backport: elf: Switch to main malloc after final ld.so
  self-relocation
- Backport: elf: Second ld.so relocation only if libc.so has been
  loaded
- Backport: elf: Minimize library dependencies of tst-nolink-libc.c
- Backport: elf: Add missing DSO dependencies for
  tst-rtld-no-malloc-{audit,preload}

Resolves: RHEL-48820
2025-06-26 17:05:57 +02:00

53 lines
1.7 KiB
Diff

commit a79642204537dec8a1e1c58d1e0a074b3c624f46
Author: Florian Weimer <fweimer@redhat.com>
Date: Wed Nov 6 10:33:44 2024 +0100
elf: Do not define consider_profiling, consider_symbind as macros
This avoids surprises when refactoring the code if these identifiers
are re-used later in the file.
Reviewed-by: DJ Delorie <dj@redhat.com>
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 0254e589c06fbf4c..ded506da9e180eac 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -207,8 +207,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
int lazy = reloc_mode & RTLD_LAZY;
int skip_ifunc = reloc_mode & __RTLD_NOIFUNC;
-#ifdef SHARED
bool consider_symbind = false;
+#ifdef SHARED
/* If we are auditing, install the same handlers we need for profiling. */
if ((reloc_mode & __RTLD_AUDIT) == 0)
{
@@ -227,9 +227,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
}
#elif defined PROF
/* Never use dynamic linker profiling for gprof profiling code. */
-# define consider_profiling 0
-#else
-# define consider_symbind 0
+ consider_profiling = 0;
#endif
/* If DT_BIND_NOW is set relocate all references in this object. We
@@ -287,7 +285,6 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
ELF_DYNAMIC_RELOCATE (l, scope, lazy, consider_profiling, skip_ifunc);
-#ifndef PROF
if ((consider_profiling || consider_symbind)
&& l->l_info[DT_PLTRELSZ] != NULL)
{
@@ -308,7 +305,6 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
_dl_fatal_printf (errstring, RTLD_PROGNAME, l->l_name);
}
}
-#endif
}
/* Mark the object so we know this work has been done. */