]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Copy l_addr/l_ld when adding ld.so to a new namespace
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 18 Aug 2021 02:36:04 +0000 (19:36 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 29 Sep 2021 23:15:44 +0000 (16:15 -0700)
commit88361b408b9dbd313f15413cc2e6be0f1cafb01a
tree8c95b7ac2ae27783ebbfae890a3921d60a452370
parentee874f44fd55988808a4a162ef21bfa2cc8dc6f7
elf: Copy l_addr/l_ld when adding ld.so to a new namespace

When add ld.so to a new namespace, we don't actually load ld.so.  We
create a new link map and refers the real one for almost everything.
Copy l_addr and l_ld from the real ld.so link map to avoid GDB warning:

warning: .dynamic section for ".../elf/ld-linux-x86-64.so.2" is not at the expected address (wrong library or version mismatch?)

when handling shared library loaded by dlmopen.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
elf/dl-load.c