aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-08-25 18:46:41 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-08-25 18:46:43 +0200
commit89baed0b93639180fd7d0ba922873b003649c7af (patch)
tree3d560f9563c042eb46fdd0a088d24e470b5e907d /elf/dl-load.c
parent025a8cce63a1d9b3ea9e84d0e844f14ec872e184 (diff)
downloadglibc-89baed0b93639180fd7d0ba922873b003649c7af.zip
glibc-89baed0b93639180fd7d0ba922873b003649c7af.tar.gz
glibc-89baed0b93639180fd7d0ba922873b003649c7af.tar.bz2
Revert "Detect ld.so and libc.so version inconsistency during startup"
This reverts commit 6f85dbf102ad7982409ba0fe96886caeb6389fef. Once this change hits the release branches, it will require relinking of all statically linked applications before static dlopen works again, for the majority of updates on release branches: The NEWS file is regularly updated with bug references, so the __libc_early_init suffix changes, and static dlopen cannot find the function anymore. While this ABI check is still technically correct (we do require rebuilding & relinking after glibc updates to keep static dlopen working), it is too drastic for stable release branches. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 00e08b5..1ad0868 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -31,6 +31,7 @@
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <gnu/lib-names.h>
/* Type for the buffer we put the ELF header and hopefully the program
header. This buffer does not really have to be too large. In most
@@ -1465,6 +1466,14 @@ cannot enable executable stack as shared object requires");
add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_SONAME]->d_un.d_val));
+ /* If we have newly loaded libc.so, update the namespace
+ description. */
+ if (GL(dl_ns)[nsid].libc_map == NULL
+ && l->l_info[DT_SONAME] != NULL
+ && strcmp (((const char *) D_PTR (l, l_info[DT_STRTAB])
+ + l->l_info[DT_SONAME]->d_un.d_val), LIBC_SO) == 0)
+ GL(dl_ns)[nsid].libc_map = l;
+
/* _dl_close can only eventually undo the module ID assignment (via
remove_slotinfo) if this function returns a pointer to a link
map. Therefore, delay this step until all possibilities for