From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 039EA3953421; Tue, 10 Aug 2021 09:59:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 039EA3953421 From: "jakub at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/14932] dlsym(handle, "foo") and dlsym(RTLD_NEXT, "foo") return different result with versioned "foo" Date: Tue, 10 Aug 2021 09:59:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2021 09:59:57 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D14932 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at redhat dot com --- Comment #4 from Jakub Jelinek --- I think changing this is highly undesirable, as written in https://marc.info/?l=3Dglibc-alpha&m=3D98313802001691&w=3D2 the current dlsym behavior provides ABI stability, no matter what you run t= he program against it will always return the same symbol. While if it returns the default symbol (there doesn't need to be any), it w= ould change behavior depending on what glibc is used at runtime. Say, you compile/link your program against glibc 2.5, which provides foobar symbol say at @@GLIBC_2.5, later glibc 2.37 comes and will have foobar @GLIBC_2.5 and @@GLIBC_2.37. Some versioned symbols are solely about adding features while keeping the ABI the same, say it handles another bitm= ask in argument that was previously rejected with -1/setting errno or similar, = say regexec, that perhaps can be handled. But in other cases the ABI of the function changes, adds/removes argument or e.g. what some argument points to changes layout (and not just in glibc, but in any versioned shared library). You really don't want your old programs to suddenly break because of that. Basically, dlsym should follow what happens when you link against a shared library before symbol versioning has been added to it (e.g. very old glibc). sanitizers need to be fixed so that the sanitizer libraries are also symbol versioned and when they wrap some glibc symbols, they follow the versioning there, i.e. if they wrap regexec and regexec is on a particular architecture regexec@GLIBC_2.2.5 and regexec@@GLIBC_2.3.4, then it wraps both of them and each of those uses dlvsym to find the corresponding symbol in glibc. --=20 You are receiving this mail because: You are on the CC list for the bug.=