From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F3EDE385782B; Tue, 17 Jan 2023 14:35:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3EDE385782B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673966159; bh=MGB014BkoGePPWhoVXW8j5x+Kj01CjZvzUJB8JjqPLQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GxJNk7d9zy/rCZt2AXg42OWrWwlWYCduqL+WYKLBXxAx71lrZnwF82Ni34y8BZiWF ceG5vR2eQZMgolTxXR8z7H1WJBm7YtU7RkJyBWBqsBsReZt9Zz+1t/t3odPugCnSXP f0v7CmpmSJwCJ/hC+ky1RyCUD9DQMAMOQLFuHzv8= From: "stsp at users dot sourceforge.net" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/30007] rfe: dlopen to user buffer or to specified address Date: Tue, 17 Jan 2023 14:35:58 +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: enhancement X-Bugzilla-Who: stsp at users dot sourceforge.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30007 --- Comment #2 from Stas Sergeev --- (In reply to Adhemerval Zanella from comment #1) > Any GNU extension requires a specific usercase that can't be easily > accomplished with current API. What problem are trying to solve that you > require to map a shared library to an specific pre-allocated address? It needs to interact with legacy 32bit code that is running in VM. The memory of the VM is mapped in a 64bit space under a particular address. I need to be able to load solib within a 4Gb range from the aforementioned address, in which case the 32bit code will be able to create the pointers to that solib's objects. Another way of solving that, is to put the solib into a MAP_SHARED buffer. In this case I will be able to create the "mirror" of that solib under any address I need, so the 32bit pointers will likely work in that case too (I will not execute functions via pointers to that window). For that, I'd probably need the following API: void *dladdr(void *handle, int *buffer_size_out); So the ability to get the address and length is probably already enough for my needs, as that will allow me to do the MAP_SHARED trick. And that can probably be made an LD_AUDIT extension, instead of a new global function. Of course I still need to test either way to make sure it really works. Which may mean that eventually I'll have to implement that extension myself. So for now this is just a query to find out if it is acceptable, and if so - in what form. --=20 You are receiving this mail because: You are on the CC list for the bug.=