From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BDA3C3858D32; Sun, 19 Mar 2023 09:47:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDA3C3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679219222; bh=U1dnLtB6KzNXXIUdvEeoIhmLaw+PSGHHfBKV558DwUY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rlaXA72Z/YazE3tRFNdrSlCqQs1zKJmkIx3hUJLhCCJ28CFUo+Ocgfg+y8yqRnmli EmeZ1yGBN/n5rKdbe/ZvxrbpYFgUONF/OWAinfgDZakPPMX04T07z4N+u2RzGFeRgs 9OC+pW9R/c67nx85z246VLfepjChjhYxKPB4hA5w= From: "stsp at users dot sourceforge.net" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/30007] rfe: dlopen to specified address Date: Sun, 19 Mar 2023 09:47:02 +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 #18 from Stas Sergeev --- (In reply to Stas Sergeev from comment #16) > I am not even sure why the first segment > should be at the beginning, does it > always have the vaddr=3D=3D0? But so do the > comments in the present code suggest. Actually it doesn't suggest that and all segments are over-mapped over the initial mapping. I'll need to re-check my changes to _dl_map_segment() to see if I got the things right. But given that all segments are over-mapped, certainly there is no reason to trap the first mmap call. Of course now I have some very bad feeling that your next proposal will be "trap all mmaps, not just the first one"... Well, before you do that, consider the following: 1. Some mappings are converted from file-based to anonymous via mprotect+memset. 2. _dl_map_segment() handles the "large alignment" case with 2 mmaps. The first large one is done only for alignment, and should I share with VM also that? 3. Do you really think that trapping all mmaps and trying to hack around the aforementioned problems, is a good idea? --=20 You are receiving this mail because: You are on the CC list for the bug.=