This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/24900] ld.so: Explicit loader invocation results in argv[0] in l_libname of main map


https://sourceware.org/bugzilla/show_bug.cgi?id=24900

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Florian Weimer <fw@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=23d2e5faf0bca6d9b31bef4aa162b95ee64cbfc6

commit 23d2e5faf0bca6d9b31bef4aa162b95ee64cbfc6
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Aug 15 14:37:50 2019 +0200

    elf: Self-dlopen failure with explict loader invocation [BZ #24900]

    In case of an explicit loader invocation, ld.so essentially performs
    a dlopen call to load the main executable.  Since the pathname of
    the executable is known at this point, it gets stored in the link
    map.  In regular mode, the pathname is not known and "" is used
    instead.

    As a result, if a program calls dlopen on the pathname of the main
    program, the dlopen call succeeds and returns a handle for the main
    map.  This results in an unnecessary difference between glibc
    testing (without --enable-hardcoded-path-in-tests) and production
    usage.

    This commit discards the names when building the link map in
    _dl_new_object for the main executable, but it still determines
    the origin at this point in case of an explict loader invocation.
    The reason is that the specified pathname has to be used; the kernel
    has a different notion of the main executable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]