From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4253 invoked by alias); 6 Sep 2013 16:42:31 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 4216 invoked by uid 48); 6 Sep 2013 16:42:31 -0000 From: "dje at google dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/11786] PIE support may not work for some PIEs Date: Fri, 06 Sep 2013 16:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: dje at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 7.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q3/txt/msg00328.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=11786 --- Comment #8 from dje at google dot com --- (In reply to Jan Kratochvil from comment #5) > (In reply to dje from comment #3) > > suppose we ignore the flags field for all segments: what's the > > worst that could happen? > > If you use non-matching build of an executable it may get incorrectly > relocated by some small displacement. (*1) > > People sometimes try to use non-matching build, IMO it cannot give > meaningful output but it may make their attempts even more difficult when > the executable gets "randomly" displaced. Currently GDB does not display > any notice it used PIE displacement (and there is also no longer any notice > it used PIC displacement), unless one has "set verbose" (which nobody has). > This may make a falsely-matched displacement a pain. > > (*1) Currently the displacement still has to be PAGE_SIZE aligned, if it is > not PAGE_SIZE aligned no displacement gets used. But I have TODOlisted I > should recheck the PAGE_SIZE requirement as it was removed for shlibs by > 2da7921acc5c7b327b3619a95ca7ca36a0314dc4 and IMO it should be equally > removed for compatibility with prelinked/unprelinked PIE executables. If the addresses/displacements are different, sure. One recognizes that going in. But I asked about the flags field. btw, 2da7921acc5c7b327b3619a95ca7ca36a0314dc4: kinda meaningless without some reference to a repository. For archeology's sake, IWBN to record that here. -- You are receiving this mail because: You are on the CC list for the bug.