From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 89CBB3858C60; Tue, 14 Dec 2021 05:31:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89CBB3858C60 From: "i at maskray dot me" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/28676] p_align on PT_LOAD segment in DSO isn't honored Date: Tue, 14 Dec 2021 05:31:41 +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: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 2.35 X-Bugzilla-Flags: 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, 14 Dec 2021 05:31:41 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28676 Fangrui Song changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |i at maskray dot me --- Comment #3 from Fangrui Song --- This is not a bug per se. My reasoning is at https://sourceware.org/pipermail/libc-alpha/2021-December/134121.html=20 `__attribute__((aligned(0x200000))) =3D 1;` does not necessarily mean the l= arge alignment needs to be satisfied on a system with a smaller page size. Now "elf: Properly align PT_LOAD segments [BZ #28676]" overaligns memory mappings to p_align to make the use case work. It's a new feature, not a bugfix. The 2020 kernel commit https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?= id=3Dce81bb256a224259ab686742a6284930cbe4f1fa has no waste, so it is more justifiable. The emulation in ld.so, however, would incur significant overhead, so it ne= eds more thoughts. At the very least, the max-page-size=3D0x200000 for -z noseparate-code on x= 86-64 may be problematic. It looks like we need more thoughts how tools like objcopy and ld can make = the cost small, or whether such changes are justifiable. --=20 You are receiving this mail because: You are on the CC list for the bug.=