From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9844 invoked by alias); 7 Mar 2010 00:53:37 -0000 Received: (qmail 9836 invoked by uid 22791); 7 Mar 2010 00:53:36 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 07 Mar 2010 00:53:33 +0000 Received: (qmail 4022 invoked from network); 7 Mar 2010 00:53:31 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Mar 2010 00:53:31 -0000 Date: Sun, 07 Mar 2010 00:53:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org Cc: Jan Kratochvil Subject: PIE question Message-ID: <20100307005326.GA29245@caradoc.them.org> Mail-Followup-To: gdb@sourceware.org, Jan Kratochvil MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00040.txt.bz2 Jan, could you explain a little how the situation in this comment can happen? static void svr4_relocate_main_executable (void) { CORE_ADDR displacement = svr4_exec_displacement (); /* Even if DISPLACEMENT is 0 still try to relocate it as this is a new difference of in-memory vs. in-file addresses and we could already relocate the executable at this function to improper address before. */ I came across this because our local ARM uClinux incorrectly links in solib-svr4.c. The remote target sends qOffsets, uses the result to relocate the objfile, and then this code overrides that. I'll fix the target. But if there was any circumstance where a solib-svr4.c target could also send qOffsets (I think some KGDB ports do this?) then this will undo it. I don't think this is related to our other discussion about executable relocation; I haven't forgotten, I'll get back to you as soon as I can. -- Daniel Jacobowitz CodeSourcery