]> sourceware.org Git - glibc.git/commit
elf: Always set l in _dl_init_paths (bug 23462)
authorCarlos O'Donell <carlos@redhat.com>
Fri, 12 Mar 2021 15:44:47 +0000 (16:44 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 12 Mar 2021 15:44:47 +0000 (16:44 +0100)
commit332421312576bd7095e70589154af99b124dd2d1
tree4f0559bb9643eca402ce049253bf069bfcb1ead6
parent08a0ebb20e06df224d1f98bb45dc00874f2f4549
elf: Always set l in _dl_init_paths (bug 23462)

After d1d5471579eb0426671bf94f2d71e61dfb204c30 ("Remove dead
DL_DST_REQ_STATIC code.") we always setup the link map l to make the
static and shared cases the same.  The bug is that in elf/dl-load.c
(_dl_init_paths) we conditionally set l only in the #ifdef SHARED
case, but unconditionally use it later.  The simple solution is to
remove the #ifdef SHARED conditional, because it's no longer needed,
and unconditionally setup l for both the static and shared cases. A
regression test is added to run a static binary with
LD_LIBRARY_PATH='$ORIGIN' which crashes before the fix and runs after
the fix.

Co-Authored-By: Florian Weimer <fweimer@redhat.com>
elf/Makefile
elf/dl-load.c
elf/tst-dst-static.c [new file with mode: 0644]
This page took 0.041896 seconds and 5 git commands to generate.